Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added __pycache__/fib.cpython-38.pyc
Binary file not shown.
6 changes: 4 additions & 2 deletions fib.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
Negative numbers should return None
"""
def fibonacci(position):
if(position == 1 or position == 2):
return 1
if(position == 0 or position == 1):
return position

return fibonacci(position - 1) + fibonacci(position - 2)
"rahul code"



Expand Down