Question #291228

loops + if combined:

question 1: input 5 numbers and calculate the sum of all numbers?

I think I should use a list of the number

I want very simple code



Expert's answer

sum_n = 0
for i in range(5):
    sum_n += int(input('input number: '))
print('Sum of all numbers:', sum_n)
LATEST TUTORIALS
APPROVED BY CLIENTS