[Tutor] Exeption errors

Kevin python_newbie at vedorian.com
Sat Aug 21 19:23:32 CEST 2004


I am playing around with Exeption Errors this is the code I did:
x=raw_input("Enter a number: ")
try:
    while int(x) != 1:
        print "Thats not 1"
        x=raw_input("Enter a number: ")
except ValueError:
        print "that is not a number"

it works to a point when I type in a number that is not a one it will keep saying Thats not 1, but when I put in a letter it will say that is not a number and then exit the program. How do I make it look again?

Thanks
Kevin


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.740 / Virus Database: 494 - Release Date: 8/16/04
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20040821/cd833cbb/attachment.htm


More information about the Tutor mailing list