I'm a little confused on how to allow the user to retry entering something in Python. I created an example code bellow. I want it so if the user types a invalid answer other than 1 or 2 it allows them to try again.
import sys
def start():
print "Hello whats your name?"
username = raw_input("> ")
print "Okay, welcome to the game %s" % username
print "Do you want to hear the background of the game?"
print "1. Yes"
print "2. No"
background = raw_input("> ")
if background == "1":
print "Background goes here."
elif background == "2":
print "Background skipped"
start()
How would I incorporate a try again option into this example? Thanks!