input_test = input("enter somethings eaten in the last 24 hrs:")
print(input_test)
enter somethings eaten in the last 24 hrs:seafood, dairy, nuts, chocolatecake
NameErrorTraceback (most recent call last)
<ipython-input-6-7bc4fc2d8475> in <module>()
----> 1 input_test = input("enter somethings eaten in the last 24 hrs:")
2 print(input_test)
/home/nbuser/anaconda2_501/lib/python2.7/site-packages/ipykernel/ipkernel.pyc in <lambda>(prompt)
174 self._sys_eval_input = builtin_mod.input
175 builtin_mod.raw_input = self.raw_input
--> 176 builtin_mod.input = lambda prompt='': eval(self.raw_input(prompt))
177 self._save_getpass = getpass.getpass
178 getpass.getpass = self.getpass
/home/nbuser/anaconda2_501/lib/python2.7/site-packages/ipykernel/ipkernel.pyc in <module>()
NameError: name 'seafood' is not defined
Asked
Active
Viewed 22 times
0

niraj
- 17,498
- 4
- 33
- 48
-
I need help understanding why I am having this error – McKenzie Bell May 08 '18 at 21:41
-
This is a py2 vs py3 error. Use `raw_input`. – Adam Smith May 08 '18 at 21:43
-
1@user2285236 argh -- I was too slow with the dupe ;) – Adam Smith May 08 '18 at 21:44