Forezz

ДЗ 9 Н 2

Jul 25th, 2019
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.16 KB | None | 0 0
  1. def fib(x):
  2.     if x == 0:
  3.         return 0
  4.     elif x == 1:
  5.         return 1
  6.     else:
  7.         return (fib(x-1) + fib(x-2))
  8.    
  9. print(fib(int(input()))
Advertisement
Add Comment
Please, Sign In to add comment