title: How do I loop a program based on user input?
body: <p>I'm wondering how I make a loop based on user input?</p>
  
  <pre><code>import random
  
  die1 = random.randrange(6) + 1  
  die2 = random.randrange(6) + 1
  total = die1 + die2
  
  raw_input("Ready to roll dice 1? Press enter if you are.")
  print "You rolled a", die1, "with dice 1."
  
  raw_input("Ready to roll dice 2? Press enter if you are.")
  print "And a", die2, "with dice 2."
  
  print "Giving you a total of", total
  </code></pre>
  
  <p>If after giving the <code>total</code> the user wanted to roll again, how would I do that? <code>Ideally Press 1 to play again or press 2 to exit.</code></p>