def fib(n): a=1.0 b=0.0 c=0.0 for i in range(0,n+1): c=b b+=a a=c return b/nprint fib(7)
Standard input is empty
3.0
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!