Adrian Kelly 1 Bramble Close Baylough Athlone County Westmeath 0879495663 From: kellyadr...@hotmail.com To: tutor@python.org Subject: null inputs Date: Thu, 15 Mar 2012 14:19:16 +0000 Hi guys, how do i prevent a user from leaving a blank when inputting? e.g. age=int(input("what age are you? ")).................. i want to stop the user pressing enter!!!! if age==""????? ************************************ age=raw_input("what age are you? ") if age=="": age=int(age) print "please enter your age" else: print "your age is ",age ************************************* i have tried this but still no luck, if anyone can help i would apprecitate it Adrian Kelly 1 Bramble Close Baylough Athlone County Westmeath 0879495663
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor