Answer to Question #318907 in Python for Cristelle Maddela

Question #318907

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.


1
Expert's answer
2022-03-27T09:05:35-0400
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)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS