I learn how to program in Python using the book "Python the Absolute Beginners Guide". The problem I am facing is that when using eclipse-pydev
it will not let me use the if
. Here is the code I wrote ...
name = input("What is your name? ") print(name) print("Hello" name )
The result was
What is your name? caleb Traceback (most recent call last): File "/Users/calebmatthias/Document/workspace/de.vogella.python.first/simpprogram.py", line 6, in <module> name = input("What is your name? ") File "/Users/calebmatthias/Desktop/eclipse 2/plugins/org.python.pydev_2.2.3.2011100616/PySrc/pydev_sitecustomize/sitecustomize.py", line 210, in input return eval(raw_input(prompt)) File "<string>", line 1, in <module> NameError: name 'caleb' is not defined
When I do my if
, I put
name = input("What is your name? ") if name == ("Caleb"): print(" Hello Bud!")
The result was
What is your name? Caleb Traceback (most recent call last): File "/Users/calebmatthias/Document/workspace/de.vogella.python.first/simpprogram.py", line 6, in <module> name = input("What is your name? ") File "/Users/calebmatthias/Desktop/eclipse 2/plugins/org.python.pydev_2.2.3.2011100616/PySrc/pydev_sitecustomize/sitecustomize.py", line 210, in input return eval(raw_input(prompt)) File "<string>", line 1, in <module> NameError: name 'Caleb' is not defined
source share