0
Write a python code of a program that asks the user to enter ten numbers then display the total
for i in range(10): i=int(input('enter the number: '))
9 Réponses
+ 2
sum up is missing🧐
add a variable sum and increase it in the loop.
+ 2
Suraiya Binte Akbar(Aaisha) change the name of the variable i on the 3rd and 4th lines, if you don't do that, you're reassigning the counter variable i on the 2nd line, and that is one of the reasons why your code is not working. The other one is that you must replace the last '':'' by a parenthesis ;)
+ 1
sum=0
for i in range(10):
i=int(input('enter the number: '))
sum = sum + i
print(sum)
0
I did it but it didn’t show all the input numbers
0
show it please
0
sum=0
for i in range(10):
i=int(input('enter the number: '):
sum=sum+i
0
Thank you Jonas Anthony Ebora
0
Welcome! Just a newbie here trying to learn Python
0
sum=0
for i in range(10):
i=int(input('enter the number: '))
sum = sum + i
print(sum)
In this way you will get desired answer