在我们使用python的输入语句时用了raw_input();但是程序却报出name ‘raw_input’ is not defined的错误提示,该函数名未定义,如下图所示
原因是raw_input在python3.x中是不支持的,它是python2.x中才支持的函数,解决办法就是用python3.x适用的输入函数input()来代替raw_input()
>>input()
在我们使用python的输入语句时用了raw_input();但是程序却报出name ‘raw_input’ is not defined的错误提示,该函数名未定义,如下图所示
原因是raw_input在python3.x中是不支持的,它是python2.x中才支持的函数,解决办法就是用python3.x适用的输入函数input()来代替raw_input()
>>input()