An iterative algorithm for Fibonacci numbers

后端 未结 13 1139
野性不改
野性不改 2020-11-28 10:37

I am interested in an iterative algorithm for Fibonacci numbers, so I found the formula on wiki...it looks straight forward so I tried it in Python...it doesn\'t have a prob

13条回答
  •  庸人自扰
    2020-11-28 11:15

    Possible solution:

    a=0
    b=1
    d=[a,b]
    n=int(input("Enter a number"))
    i=0
    while len(d)

提交回复
热议问题