compiler errors - Trouble Running A Python Script -


here's code:

name = input("what's name? ") print("nice meet " + name + "!") 

but when enter name, example "john", gives me error:

traceback (most recent call last):   file "name.py", line 1, in <module>     name = input("what's name? ")   file "<string>", line 1, in <module> nameerror: name 'john' not defined 

the version of python i'm using "2.7.10".

you need use raw_input rather input, latter attempts evaluate enter while former keeps string.


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -