How to input variables in python


#1

print “How old are you?”,
age = raw_input ()

How old are you? Traceback (most recent call last):
File “C:\Users\Lenovo\Desktop\LPyTHW\ex11.py”, line 3, in
age = raw_input ()
EOFError: EOF when reading a lin


#2

What package are you using to run the code? Does it work when you run the script through the python executable using the command line?


#3

I used ‘Atom Runner’ to run python . It worked when I used command line and ipython notebook.


#4

It works fine in build and script. Anyway, none of these packages are REPLs, so you wouldn’t be able to input the age anyway. Could that be why atom-runner is failing, because the script never exits properly?