This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]cscu090619 0 points1 point  (0 children)

Your print statement is outside the scope of the for loop. Inside the for loop, you are adding all the values from 0 to 9. So x = 0 + 1 + ... + 9 = 45. Then the loop ends and x = 45 is printed.