ZRZRZRZRZZ
2021-04-06 19:46
采纳率: 100%
浏览 45

求大佬帮忙解答这个python斐波那契数列代码怎么续

def fib(n):
    if n==1:
        print(1)
    elif n==2:
        print(1,1)
    elif n>2:
        print(1,1,end=" ")
    count = 0
    n1 = 1
    n2 = 1
    while count < n-2:
        nth = n1 + n2
        print(nth,end=" ")
        # add your program here to complete it

3条回答 默认 最新

相关推荐 更多相似问题