def fib(n): a,b = 1,1 for i in range(n-1): a,b = b,a+b return a n = 10m = 5 print(fib(n) % m)
Standard input is empty
0
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!