python递归实现斐波那契数列:
def fibonacci_recursive(n):
if n <= 1:
return n
else:
return fibonacci_recursive(n-1) + fibonacci_recursive(n-2)
# 输出斐波那契数列的前n项
n = 10 # 指定要输出的斐波那契数列项数
for i in range(n):
print(fibonacci_recursive(i), end=" ")