title: how to make a delay and print it?
body: <p>anyone can help me. I am working on the traffic light and I want to make a delay for green and red lights and print so I tried this code:</p>
  
  <pre><code>   import time
     t=10
     while True:
         time.sleep(1)
         print(t)
         t = t - 1
         if(t==0):
             break
  </code></pre>
  
  <p>but it repeated twice:</p>
  
  <pre><code>  10
    9
    8
    7
    6
    5
    4
    3
    2
    1
    10
    9
    8
    7
    6
    5
    4
    3
    2
    1
  </code></pre>
  
  <p>i expected :</p>
  
  <pre><code> 10
   9
   8
   7
   6
   5
   4 
   3
   2
   1
   0
  </code></pre>