Null number input

Tyson Tate nilobject at
Sun Jan 26 21:55:52 CET 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 
	userInfo["SSN"] = input("SSN: ")

Would I have to do something like int(raw_input("Age: ")) or is there a 
better way?


Tyson Tate, Editor
Entropy Magazine
"Nourishment For The Starved."

More information about the Python-list mailing list