On Sun, Mar 31, 2013 at 12:39 PM, Soliman, Yasmin <[email protected]> wrote:
> So if it should look like this, it gives error that says Quit is not defined,
> also why does it not recognize the sys import when I run it?
>
> import weekday_string1
> import sys
> while True:
> ryear = raw_input("year= ")
> print ryear
>
> if ryear == 'Quit':
> print '\nThank you for using this program! Bye.'
> break
Okay, here is a small program:
while True:
ryear = raw_input("year= ")
print ryear
if ryear == 'Quit':
print '\nThank you for using this program! Bye.'
break
else:
print 'Not quitting'
When I run this, I see:
year= 10
10
Not quitting
year= 10
10
Not quitting
year= 20
20
Not quitting
year= Quit
Quit
Thank you for using this program! Bye.
As you can see, when I enter "Quit", it exists. Can you try and see if
that works for you?
Best,
Amit.
--
http://amitsaha.github.com/
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor