Answer to Question #303165 in Python for reyad

Question #303165

Write a Python code that will read 5 numbers from the user. Your program should print the first number, the sum of the first 2 numbers, the sum of the first 3 numbers, and so on up to the sum of 5 numbers.




==========================================================




Sample Input 1:



1



2



3



4



5




Sample Output 1:



1



3



6



10



15

1
Expert's answer
2022-02-27T04:23:58-0500
sum = 0;
for _ in range(5):
  sum = sum + int(input())
  print(sum)

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