您的位置:首页 > 编程语言 > Python开发

Python3.3 input v.s. raw_input

2014-02-28 21:40 465 查看
print("The world of python welcomes to you!")
name = raw_input("What is your name? ")
print("Hello, " + name + "!")



print("The world of python welcomes to you!")
name = input("What is your name? ")
print("Hello, " + name + "!")




在windows下双击附件hllo.py文件,运行结果:



最后一行代码改为raw_input函数,则程序运行完毕,来不及看结果,窗口也跟着关闭。
附件hello.py文件代码内容:
print("The world of python welcomes to you!")
name = input("What is your name? ")
print("Hello, " + name + "!")
input("Press <Enter>")


本文出自 “飒飒秋风” 博客,请务必保留此出处http://xjhznick.blog.51cto.com/3608584/1365232
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: