我有字符串变量测试,在Python 2.7中这很好用.
test = raw_input("enter the test")
print test
Run Code Online (Sandbox Code Playgroud)
但是在Python 3.3中.我用
test = input("enter the test")
print test
Run Code Online (Sandbox Code Playgroud)
使用输入字符串test,我收到一条错误消息
Traceback(最近一次调用最后一次):
文件"/home/ananiev/PycharmProjects/PigLatin/main.py",
第5行,在test = input("输入测试")
NameError中的文件"",第1行:名称'sdas'未定义