title: Replacing printed output in python not working as expected
body: <p>I've been trying to make a program in python that <strong>replaces</strong> the printed value in the console with the next value, in essence making a rudimentary timer.</p>
  
  <p>After looking through the web for a while, I landed on this bit of code:</p>
  
  <pre><code>import time
  
  number = 0
  
  while True:
      print(number, end = "\r")
      number += 1
      time.sleep(1)
  </code></pre>
  
  <p>This would supposedly remove the previously printed number and replace it with a new one, but instead I got this output:</p>
  
  <pre><code>0123456789
  </code></pre>
  
  <p><a href="https://www.youtube.com/watch?v=wobwvvj9XZA" rel="nofollow noreferrer">video</a></p>
  
  <p><a href="https://i.stack.imgur.com/lvgHY.png" rel="nofollow noreferrer">image</a></p>
  
  <p>What is going on?</p>