Null number input
Tyson Tate
nilobject at mac.com
Sun Jan 26 15:55:52 EST 2003
When I use raw_input, I'm able to not enter anything and just hit
return, yet with input, I get "unexpected EOF while parsing" if I don't
enter anything. The code I am using is as follows (my remarks = #):
userInfo["firstName"] = raw_input("First Name: ") # Works fine
userInfo["lastName"] = raw_input("Last Name: ") # same here
userInfo["age"] = input("Age: ") # entering nothing gives me the
error
userInfo["SSN"] = input("SSN: ")
Would I have to do something like int(raw_input("Age: ")) or is there a
better way?
TIA
--
Tyson Tate, Editor
Entropy Magazine
"Nourishment For The Starved."
http://www.entropymag.net
More information about the Python-list
mailing list