In the Absence of a GoTo Statement: Newbie needs menu-launcher to choose amongst sub-programs

Ron Stephens rdsteph at earthlink.net
Fri Apr 13 16:30:57 EDT 2001


Steve offered me this good code:

choice = raw_input("Option: ")
if choice == 1:
    # code for case 1
elif choice == 2:
    # code for case 2
elif choice == 3:
    :
    :
else:
    print "Invalid choice"

Steve, thanks. I guess in this case, when the code for a choice finishes
executing, program flow would go to (Alex: sorry about that particular choice of
words;-))) the end, or right after the print "invalid choice " statement...?




More information about the Python-list mailing list