The below line of code runs however the while loop doesn't stop when len(fib_list) reaches < 20. It continues instead to add on to the list albeit backwards. Any ideas?
fib_list = [0,1]
def fib(n, sum):
while len(fib_list) < 20:
for i in range(n, len(fib_list)):
sum += fib_list[i]
n += 1
print(n, sum, len(fib_list))
fib_list.append(sum)
fib(n, sum)
else:
break
fib(0, 0)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…