title: Trying to create a piece of code that acts like a switch being toggle on or off
body: <pre><code>def Switch(toggle = 0):
      if toggle == 0:
          toggle = 1
          while toggle == 1:
              print('hello world')
  
      else:
          toggle = 0
          time.sleep(0.3)
  </code></pre>
  
  <p>This is the code that I have but my problem is when I press my designated hotkey it never stops printing even when I press it again</p>