Skip to content
Open
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
6 changes: 5 additions & 1 deletion fib.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ def fib_recursion(n):

It uses for loop to calculate it.
'''

def F(x):
if x == 0: return 0
elif x == 1: return 1
else:
return F(x-1)+F(x-2)
def fib_generator(n):
'''
Generator version of fibonacci.
Expand Down