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.
I need the code to have an output stated above.
n = int(input('Enter 1st number: '))
k = int(input('Enter 2st number: '))
list = []
list.append(n)
fib1 = fib2 = k
for i in range(n, 12):
fib1, fib2 = fib2, fib1 + fib2
list.append(fib1)
print(list)
Comments
Leave a comment