Python How to Change Value in Loop
<p>There's a code I'm attempting to reverse-engineer for an assignment. The program asks you to enter an integer and it'll loop the words "Line (loop it's on) Hello World" as many times as the number you entered. On the first loop, it said 'Line 1', on the second, it said 'Line 2' and on the third, it said 'Line 3' etc all the while repeating the Hello World right after.</p>

<p>How would I achieve the effect of changing the number each loop? Also, how do I make it loop as many times as the number inputted? My version is Python 3.4.</p>

<p>Something like this?</p>

<pre><code>for n in range(int(input())):
    print("Line", n+1, "Hello World")
</code></pre>

<p>The <code>range</code> function gives you an iterator with a value <code>0</code>, <code>1</code>, <code>2</code>, ..., <code>n-1</code>. </p>

python loops