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