fork download
  1. def fibonacci(n):
  2. f0=0
  3. f1=1
  4. for i in range (2,n+1):
  5. f=f0+f1
  6. f0=f1
  7. f1=f
  8. return f
  9.  
  10. print (fibonacci(9))
Success #stdin #stdout 0.02s 9116KB
stdin
Standard input is empty
stdout
34