Home > database >  Python, want to ask about the Fibonacci sequence for hair
Python, want to ask about the Fibonacci sequence for hair

Time:10-29

The Fibonacci sequence with the function, the recursion how to pray

CodePudding user response:

Double parameters, a minus 1, a reduction of 2, process to want to cough up, to thinking, otherwise your brain will rust

CodePudding user response:

 def Fibonacci (n, a=0, b=1) : 
If n & lt; 0:
Return
Print (a)
Fibonacci (n - 1, b, a + b)

Fibonacci (5)