Printing a line by updating an already outputted line
<p>Forgive me if the title is not lucid, but I could not better describe it in a single sentence. </p>

<p>Consider I have the following in a loop, which increments <code>counter</code> each time it runs.</p>

<p><code>output_string = 'Enter the number [{0}]'.format(counter)</code></p>

<p>When I do a <code>print output_string</code>, the output goes like:</p>

<pre><code>Enter the number [1]: 
</code></pre>

<p>When I print this line again with the incremented number, like:</p>

<pre><code>Enter the number [2]:
</code></pre>

<p>It will of course follow the 1st line and the cumulative output would be:</p>

<pre><code>Enter the number [1]:
Enter the number [2]:
</code></pre>

<p>However, I don't want this. I want the first line line should be updated and without adding another line, the output should just change in the first line itself.</p>

<p>Like, it should display <code>Enter the number [1]:</code> and after that it should do an in-place replacement for [1] and the screen should read: <code>Enter the number [2]</code>, without adding an extra line.</p>

<p>I hope I am being clear. The reason I am doing this is because I am taking in large inputs from the user and I don't want to clutter up the terminal when I can just keep on incrementing what I want within a single line.</p>
