a guest Jul 16th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #recursive function
  2. def fib(n):
  3.     if n==0:
  4.         return 0
  5.     elif n==1:
  6.         return 1
  7.     else:
  8.         return fib(n-1)+fib(n-2)
  9. n=int(input())
  10. print(fib(n))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand