<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
<BR><BR>Adrian Kelly <BR>1 Bramble Close<BR>Baylough<BR>Athlone<BR>County Westmeath<BR><BR>0879495663<BR><BR> <BR>
<DIV>
<DIV id=ecxSkyDrivePlaceholder></DIV>
<HR id=ecxstopSpelling>
From: kellyadrian@hotmail.com<BR>To: tutor@python.org<BR>Subject: null inputs<BR>Date: Thu, 15 Mar 2012 14:19:16 +0000<BR><BR>
<STYLE>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}
</STYLE>
<DIV dir=ltr>Hi guys, <BR>how do i prevent a user from leaving a blank when inputting?<BR> <BR>e.g. <BR>age=int(input("what age are you? ")).................. i want to stop the user pressing enter!!!!<BR> <BR>if age==""?????<BR><BR> <BR><FONT size=3><FONT color=#000000><FONT face="Times New Roman"> </FONT></FONT></FONT><FONT size=3><FONT color=#000000><FONT face="Times New Roman"> ************************************</FONT></FONT></FONT></DIV>
<DIV dir=ltr>age=raw_input("what age are you? ")<BR>if age=="":<BR> age=int(age)<BR> print "please enter your age"<BR>else:<BR> print "your age is ",age<BR> *************************************</DIV>
<DIV dir=ltr>i have tried this but still no luck, if anyone can help i would apprecitate it<BR><FONT size=3><FONT color=#000000><FONT face="Times New Roman"> </FONT></FONT></FONT><FONT size=3><FONT color=#000000><FONT face="Times New Roman"> </FONT></FONT></FONT><BR><BR>Adrian Kelly <BR>1 Bramble Close<BR>Baylough<BR>Athlone<BR>County Westmeath<BR><BR>0879495663<BR><BR></DIV></DIV>                                            </div></body>
</html>