My problem is choice 3. Exit, if you select no or put an invalid answer... It will run menu1... but then it runs name = raw_input ("Enter your character name. ") print "Your character name is:", name
How can i make it so it prints menu1 like normal... then asks you to enter your selection again? instead of running the above code. -Thank you import sys def menu(): menu1 = """ Pick A Class From The Menu or choose Exit. 1. Warrior 2. Mage 3. Exit """ print "Welcome to Iris's Last Breath" print menu1 characterChoice = input ("Enter your choice. ") print if characterChoice == 1: print """ *Place Holder* """ elif characterChoice == 2: print "Currently under construction.\nPlease choose again." print menu1 elif characterChoice == 3: endProgram = raw_input ("Do you want to end program? yes or no ") if endProgram == "yes": sys.exit(0) elif endProgram == "no": print menu1 else: print "\nInvalid Command:\nSelect from the menu again.\n" print menu1 print name = raw_input ("Enter your character name. ") print "Your character name is:", name
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor