小编Den*_*iev的帖子

python 3中的输入字符串

我有字符串变量测试,在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'未定义

python string eval input python-3.x

11
推荐指数
2
解决办法
10万
查看次数

标签 统计

eval ×1

input ×1

python ×1

python-3.x ×1

string ×1