title: exiting a python script to terminal after the script has been restsrted
body: <p>I've been learning python this week, which started with a snake game tutorial. I've then added features to the game to make it awesome. One feature I have added is the ability to restart the game once the snake has died. Upon death, a screen comes up which prompts the user to press y or n to restart the game. Pressing y always restarts the game, which I'm pretty pleased with. Pressing n exits the script back to the terminal, but only if the game is only played once. If the game is played twice, then n is selected, the screen goes black and everything is unresponsive. Upon snake death, a function is called. There are some other bits and pieces but I believe this is where the problem occurs:</p>
  
  <pre><code>while True:
      for evt in pygame.event.get():
          if evt.key == ord('y')
              restart = "y"
              break
          elif evt.key == ord('n'):
              restart = "noty"
              break
  if restart == 'y'
      os.execl(sys.executable, sys.executable, × sys.argv)
  else:
      pygame.quit()
      sys.exit()
      os.exit()
  </code></pre>
  
  <p>Thanks in advance        </p>