Develop a Python application that will accept two non-negative integers and store them in a list and will append ten additional values equivalent to the sum of the two previous elements of the list.
Sample Output:
First Number: 1
Second Number: 3
[1, 3, 4, 7, 11, 18, 29, 47, 76, 123, 199, 322]
L = []
x = int(input('First Number: '))
L.append(x)
x = int(input('Second Number: '))
L.append(x)
for i in range(10):
x = L[-1] + L[-2]
L.append(x)
print(L)
Comments
Leave a comment