fork download
  1. def fib(n):
  2. a=1.0
  3. b=0.0
  4. c=1.0
  5. for i in range(0,n+1):
  6. print b
  7. c=b
  8. b+=a
  9. a=c
  10. return
  11. fib(7)
Success #stdin #stdout 0.02s 4676KB
stdin
Standard input is empty
stdout
0.0
1.0
1.0
2.0
3.0
5.0
8.0
13.0