[Tutor] Fwd: (no subject)

Amit Saha amitsaha.in at gmail.com
Sun Mar 31 04:33:22 CEST 2013


Sorry, forgot to have tutor in the CC.

On Sun, Mar 31, 2013 at 12:08 PM, Soliman, Yasmin <ysoliman at uncc.edu> wrote:
> Sure here it is:
>
> import weekday_string1
> while True:
>     ryear = raw_input("year= ")
>     print ryear
>     if not ryear.isdigit():
>         print '\nThank you for using this program! Bye.'
>         break

if ryear == 'Quit':
    print '\nThank you for using this program! Bye.'
    break

This will exit out of the While loop. So, if you have code after the
while loop, they will be executed. If you want to completely exit the
program, use the sys.exit() function from the sys module.

Does that help?

-Amit.


--
http://amitsaha.github.com/


More information about the Tutor mailing list