I'm asking the user if they want to go first or not and use input validation so that only "y" "Y" "n" or "N" are accepted as a valid response. my code seems to crash when i run it.
choice = raw_input("Would you like to go first or not? (y/Y or n/N): ")
print ""
try:
valid_choice = False
while not valid_choice:
if choice == "y" or choice == "Y":
users_turn = True
valid_choice = True
elif choice == "n" or choice == "N":
users_turn = False
valid_choice = True
break
else:
print "Invalid Choice."
except NameError:
print "You can only enter y/Y or n/N"
breakin if clause