Py学习  »  问与答

请教个初级问题

yefengzju • 6 年前 • 1360 次点击  

我按教程输入 name = raw_input("what's your name?") print ‘hello’+name

显示Traceback (most recent call last): File "C:/Users/HP/AppData/Local/Programs/Python/Python36/yeah's program/input name.py", line 1, in <module> name = raw_input("what?") NameError: name 'raw_input' is not defined

请教下,问题出在哪,谢谢

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/4775
 
1360 次点击  
文章 [ 2 ]  |  最新文章 6 年前
yefengzju
Reply   •   1 楼
yefengzju    6 年前

多谢,我再试试

Py站长
Reply   •   2 楼
Py站长    6 年前

是不是安装不正确,我的是可以的哈,python3应该也是可以的

➜  ~ python
Python 2.7.8 (default, Sep 17 2014, 00:08:47)
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> name = raw_input("what's your name?")
what's your name?ddd
>>> print 'hello' + name
helloddd