git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

The sum of ten numbers inserted from the user


> 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