📜  使用递归的斐波那契数列 - Python 代码示例

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

代码示例1
def fib (n):
  if n == 0 or n ==1:
      return n  
  else:
        return fib(n-2) + fib(n-1)
#n = int(input("please enter a number  "))

n=10
for index,num in enumerate(range(n+1)):
     print(f"F{index} :", fib(num))