“Talk is cheap. Show me the code.”

def fun(n):
   if n <= 1:
       return n
   else:
       return fun(n - 1) + fun(n - 2)

for i in range(10):
   print(fun(i))
Forgot your password?

Explore Help About GitLab