Python 学习之输入输出

来源:互联网 发布:清理上网痕迹软件 编辑:程序博客网 时间:2024/05/16 12:15

版本3中输入没有了raw_input,如果用raw_input会出现以下错误:

>>> name = raw_input()
Traceback (most recent call last):
  File "<pyshell#13>", line 1, in <module>
    name = raw_input()
NameError: name 'raw_input' is not defined


直接用input即可:

>>> name=input()
csdn
>>> name
'csdn'

0 0
原创粉丝点击