jumboframe

Fibonacci

Jun 7th, 2018
79
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. n = int(input())
  2.  
  3. first = 1
  4. second = 1
  5.  
  6. if (n ==1 ) or (n == 0 ):
  7.     print (1)
  8.     exit(0)
  9.  
  10. for i  in range (2, n+1):
  11.     f = first + second
  12.     first = second
  13.     second = f
  14.  
  15. print (f)
RAW Paste Data