[Tutor] Simple User Entry Verification

R. Alan Monroe amonroe at columbus.rr.com
Sat Mar 14 23:07:33 CET 2009


> Newbie here who can't figure out why this doesn't work:

> start = input("Please enter the starting number.\n>")
> print(type(start))
> while type(start)!=float:
>     start = input("Sorry, that number was invalid.\nPlease enter the
starting number.\n>>")
>     print(type(start))

Google to the rescue. Try this:
while not isinstance(start, float)


Alan



More information about the Tutor mailing list