title: Pause and Continue a Loop When Press Key in Python
body: <p>Who can help me on this?</p>
  
  <p>Pause Countdown when press "P" Key and continue the Countdown when press "S" key. Until now i have this code, but i cant find the way to solve this.</p>
  
  <p>Thanks</p>
  
  <pre><code>from multiprocessing import Process
  import keyboard
  import time
  
  
  def countdown_1():
      i=6
      j=40
      k=0
      while True:
          a = keyboard.read_key()
  
          if(str(a) != "p"):    
              if(j==-1):
                  j=59
                  i -=1
              if(j &gt; 9):  
  
                  print(str(k)+str(i)+":"+str(j))
              else:
  
                  print(str(k)+str(i)+":"+str(k)+str(j))
  
              time.sleep(1)
              j -= 1
              if(i==0 and j==-1):
                  break
      if(i==0 and j==-1):
          print("END")
          time.sleep(1)
  
  
  countdown_1()
  </code></pre>