title: How to stop a function
body: <p>For example:</p>
  <pre><code>def main():
      if something == True:
          player()
      elif something_else == True:
          computer()
  
  def player():
      # do something here
      check_winner()  # check something 
      computer()  # let the computer do something
  
  def check_winner(): 
      check something
      if someone wins:
          end()   
  
  
  def computer():
      # do something here
      check_winner() # check something
      player() # go back to player function
  
  
  def end():
      if condition:
          # the player wants to play again:
          main()
      elif not condition:
          # the player doesn't want to play again:
          # stop the program
  
       
      # whatever i do here won't matter because it will go back to player() or computer()
  
  main()  # start the program
  </code></pre>
  <p>My problem is that if a certain condition becomes true (in the function <code>check_winner</code>) and function <code>end()</code> executes it will go back to <code>computer()</code> or <code>player()</code> because there's no line that tells the computer to stop executing <code>player()</code> or <code>computer()</code>. How do you stop functions in Python?</p>