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


--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to