Python 2 里的input被识别成python表达式,所以输入的字符串会被识别为表达式,如果表达式未定义则会出现如下错误 “nameerror name is not defined”。在python2中需要使用raw_input在识别输入的字符串。
Python3里的input可以直接识别输入的字符串。
Python 2 里的input被识别成python表达式,所以输入的字符串会被识别为表达式,如果表达式未定义则会出现如下错误 “nameerror name is not defined”。在python2中需要使用raw_input在识别输入的字符串。
Python3里的input可以直接识别输入的字符串。