<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>I just changed the code to look like this and it
works good. Is there a simpler way to do this?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>def one():<BR> x=raw_input("Enter
a number: ")<BR>
try:<BR> while int(x) !=
1:<BR> print
"Thats not
1"<BR>
x=raw_input("Enter a number: ")<BR> except
ValueError:<BR>
print "that is not a
number"<BR>
one()<BR>
else:<BR>
print "Thats the number 1!!"</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>one()</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=python_newbie@vedorian.com
href="mailto:python_newbie@vedorian.com">Kevin</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=tutor@python.org
href="mailto:tutor@python.org">Python</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Saturday, August 21, 2004 1:23
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Tutor] Exeption errors</DIV>
<DIV><BR></DIV>
<DIV><FONT face=Arial size=2>I am playing around with Exeption Errors this is
the code I did:</FONT></DIV>
<DIV><FONT face=Arial size=2>x=raw_input("Enter a number:
")<BR>try:<BR> while int(x) !=
1:<BR> print "Thats not
1"<BR> x=raw_input("Enter a number:
")<BR>except ValueError:<BR> print
"that is not a number"</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>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?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks</FONT></DIV>
<DIV><FONT face=Arial size=2>Kevin</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><BR>---<BR>Outgoing mail is certified Virus
Free.<BR>Checked by AVG anti-virus system (<A
href="http://www.grisoft.com">http://www.grisoft.com</A>).<BR>Version: 6.0.740
/ Virus Database: 494 - Release Date: 8/16/04</FONT></DIV>
<P>
<HR>
<P></P>_______________________________________________<BR>Tutor maillist
-
Tutor@python.org<BR>http://mail.python.org/mailman/listinfo/tutor<BR></BLOCKQUOTE></BODY></HTML>