Skip to content

Instantly share code, notes, and snippets.

@zyryc
Created December 25, 2020 10:19
Show Gist options
  • Save zyryc/3df88f9d3cfa2449f25cacd3933e3e49 to your computer and use it in GitHub Desktop.
Save zyryc/3df88f9d3cfa2449f25cacd3933e3e49 to your computer and use it in GitHub Desktop.
def fib(n):
if n<=0:
print("invalid input")
elif n==1:
return 0
elif n==2:
return 1
else:
return fib(n-1)+fib(n-2)
# print(fib(10))
#lets print al the values
for n in range(2,11):
print(fib(n))
#happy coding !!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment