title: Exit function in python
body: <pre><code>import random
  import sys
  
  player_oneN = input(&quot;Enter Name for Player One&quot;)
  player_twoN = input(&quot;Enter Name for Player Two&quot;)
  player_oneS = 0
  player_twoS = 0
  if player_oneN == &quot;stop&quot; or &quot;exit&quot;:
      c = int(input(&quot;Press 1 to continue and 0 to quit :&quot;))
      if c == 0:
          sys.exit()
  if player_twoN == &quot;stop&quot; or &quot;exit&quot;:
      c = int(input(&quot;Press 1 to continue and 0 to quit :&quot;))
      if c == 0:
          sys.exit()
  </code></pre>
  <p>whenever I try to run this code the options to exit the program always displays. I only want this option to come available when the user enters exit or stop in the player one and player two input.</p>