Lesson 7: Fibonacci sequence
Post date: Nov 30, 2017 4:00:43 PM
fibonacci = []
fibonacci.append(0)
fibonacci.append(1)
print("Fibonacci sequence:", fibonacci)
print("Length:", len(fibonacci))
fibonacci.append(fibonacci[0] + fibonacci[1])
print("Fibonacci sequence:", fibonacci)
print("Length:", len(fibonacci))
for x in range (0,100):
length = len(fibonacci)
new = fibonacci[length - 1] + fibonacci[length - 2]
fibonacci.append(new)
print("Fibonacci sequence:", fibonacci)
print("Length:", len(fibonacci))