Advertisement
Carotte

Fibo en recursif

Dec 6th, 2019
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. def fibonacci(n):
  2.     if(n <= 1):
  3.         return n
  4.     else:
  5.         return (fibonacci(n-1) + fibonacci(n-2))
  6. n = int(input("Entrez jusqu a quel nombre on veut:"))
  7. for i in range(n):
  8.     print(fibonacci(i))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement