I have been using python on eclipse and I have been having trouble when I ask a question and the response includes letters(number answers work). for example if I ask
x=input("what is your name")
print(x)
this will give me an error message similar to the one on the bottom. below is something I was trying out with the same error as the above code.
x=input("enter a number")
y=input("enter a second number")
z=input("add, divide, or multiply?")
if(z == "add"):
print(x+y)
if(z == "divide"):
print(x/y)
if(z == "multiply"):
print(x*y)
else:
print("error")
below is what i get once i get to the part where i have to choose "add, divide, or multiply"
Traceback (most recent call last):
File "/Users/jacobmaldonado/Desktop/untitled folder/abc/src/def.py", line 10, in <module>
z=input("add, divide, or multiply?")
File "/Users/jacobmaldonado/Downloads/Eclipse.app/Contents/Eclipse/plugins/org.python.pydev_4.2.0.201507041133/pysrc/pydev_sitecustomize/sitecustomize.py", line 141, in input
return eval(raw_input(prompt))
File "<string>", line 1, in <module>
NameError: name 'add' is not defined