Advertisement
TheMagnusRex

fibonachi

Dec 14th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.10 KB | None | 0 0
  1. def fib(x):
  2.     if x==2 or x== 1:
  3.         return 1
  4.     else:
  5.         return fib(x-1)+fib(x-2)
  6. x=input()
  7. print fib(x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement