您的位置:首页 > 编程语言 > Python开发

name 'raw_input' is not defined(Python 报错)

2017-05-25 20:57 501 查看
Traceback (most recent call last):

  File "<pyshell#24>", line 1, in <module>

    input_A = raw_input("input a float:")

NameError: name 'raw_input' is not defined

初学Python,书上的代码就报错了。

其实是因为:新版本Python取消了raw_input,input与其等价。所以替换即可。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: