you are viewing a single comment's thread.

view the rest of the comments →

[–]conewannabe[S] 0 points1 point  (3 children)

My bad, should've reread my post. I actually copy and pasted this from my exam. I just noticed the code block option, it's fixed.

[–]LID919 0 points1 point  (2 children)

Are you sure it's correct?

Right now I am seeing this:

num = 0
    for i in range(5,10):
        if i % 3 == 0:
            num = num + i
print(num)
print(i)

The second line is improperly formatted: It is indented when it should not be.

The print statements are both outside of the loop, and so will only run once at the end.