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