📜  用于打印斐波那契数的 python 程序 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:26.213000             🧑  作者: Mango

代码示例1
#Python program to generate Fibonacci series Program using Recursion
def Fibonacci_series(Number):if(Number == 0):
    return 0elif(Number == 1):
    return 1else:
    return (Fibonacci_series(Number - 2) + Fibonacci_series(Number - 1))

n = int(input("Enter the value of 'n': "))
print("Fibonacci Series:", end = ' ')
for n in range(0, n):
  print(Fibonacci_series(n), end = ' ')