How do I calculate something inside a 'for' loop?
<p>I'm doing an assignment in which I have to move a simulated robot across the screen in a loop - I've got that part down, however, between loops, I also have to print the percentage of area covered with each movement - that's my issue.</p>

<p>I googled a bit and even found someone with the same problem, however, I'm not sure if I'm doing it properly.</p>

<p>This code was offered:</p>

<pre><code>percent_complete = 0

for i in range(5):
    percent_complete += 20
    print('{}% complete'.format(percent_complete))
</code></pre>

<p>However, after an error, further googling revealed that only worked with certain versions </p>

<p>so I used this code:</p>

<pre><code>percent_complete = 0

for i in range(5):
        percent_complete += 20
        print '% complete' % (percent_complete)
</code></pre>

<p>And, at the very least, it now executes the code, however, the output when printing is the following:</p>

<pre><code>Here we go!
hello
omplete
hello
(omplete
hello
&lt;omplete
hello
Pomplete
hello
domplete
</code></pre>

<p>What is the cause of this? I assume because one of the codes had to be edited, the other parts do as well, but I'm not sure what needs to be done.</p>
