title: How do I ask the user if they want to play again and repeat the while loop?
body: <p>Running on Python, this is an example of my code: </p>
  
  <pre><code>import random 
  
  comp = random.choice([1,2,3])
  
  while True:
       user = input("Please enter 1, 2, or 3: ")
       if user == comp
               print("Tie game!")
       elif (user == "1") and (comp == "2")
               print("You lose!")
               break
       else:
               print("Your choice is not valid.")
  </code></pre>
  
  <p>So this part works. However, how do I exit out of this loop because after entering a correct input it keeps asking "Please input 1,2,3".</p>
  
  <p>I also want to ask if the player wants to play again:</p>
  
  <p><strong>Psuedocode:</strong></p>
  
  <pre><code>     play_again = input("If you'd like to play again, please type 'yes'")
       if play_again == "yes"
           start loop again
       else:
           exit program
  </code></pre>
  
  <p>Is this related to a nested loop somehow?</p>