> while cal_opt != 9:
>    menu()
>    cal_opt = cal()
>    if cal_opt == 1:
>    elif cal_opt == 2:
...
>    elif cal_opt == 7:
>    else:
>        print "That's not an option. Try again."
>        menu()
>        cal()

Because you don't have a specific check for the exit value (9) the 
else part gets executed which asks the user for another value.
If you put in a test for 9 that does nothing (ie use 'pass') 
then the while loop will fail on its next attempt and the 
program will stop. 

Other options inclde using 'break' to break out of the loop when 
cal_opt == 9 or using 'continue' to force the while loop to start 
again.

HTH,

Alan G
Author of the Learn to Program web tutor
http://www.freenetpages.co.uk/hp/alan.gauld


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to