The sum of ten numbers inserted from the user

^Bart gabriele1NOSPAM at hotmail.com
Fri Feb 8 03:58:07 EST 2019


> x = 0
> for jnk in range(10):
> 	x += int(input("Enter a number: ")
> print(x)

It works, there's a missed )

A colleague did:

total=0
for n in range(10):

     n= int(input("Enter a number: "))
     total=total+n

print(total)

I understood your code is more clean!

^Bart




More information about the Python-list mailing list