Why is it crashing? (newbie)

Charles Mantha charles_mantha at hotmail.com
Sun Jul 7 19:27:50 EDT 2002


got it working :
menu()
menu_choice = 0
while menu_choice <= 3:
    try:
        menu_choice = int(raw_input("Choose one of the options: "))
        if menu_choice == 1:
            run_test(get_questions())
            break
        elif menu_choice == 2:
            print get_questions()
        elif menu_choice == 3:
            raise SystemExit
    except ValueError:
        print "That is not a number."


"MontrezVosSeins"
>
> Oeps, sorry about my 2 posts, didn't know it took 3h to 9h
>
> > maybe this should do it,
> >
> > menu()
> > menu_choice = input("Choose one of the options: ")
> > if menu_choice == 1:
> >       run_test(get_questions())
> > elif menu_choice == 2:
> >       ...
> > elif menu_choice == 3:
> >       print "Byee"
> > else:
> >       print "Whoops, illegal choice, try again."





More information about the Python-list mailing list