Skip to content

return should be 1 when n <= 2 #11

Description

@aramay

line 20 in file fib2.py should return 1 when n <=2

ATM it returns n

Activity

  1. davecom commented on Nov 18, 2019

    @davecom
    Owner

    It depends on if you consider the first number in the sequence to be 0 or 1. As it stands right now, if n is 0 it will return 0 and if n is 1, it will return 1.

    We consider the first numbers to be 0 and 1. So, our sequence is 0, 1, 1, 2, 3, 5, etc.

    Therefore returning 0 when n is 0 and 1 when n is 1 is correct as it stands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions