Nothing fancy, just a personal log with a built in search function so I can recall what is easily forgotten.
fibs = [] for i in range(20): fibs.append(i) if (i==0) or (i==1) else fibs.append(fibs[i-1] + fibs[i-2]) i += 1 print(fibs)
[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181]
No comments:
Post a Comment