首页 > 编程语言 > 详细

Python3.3 input v.s. raw_input

时间:2014-03-01 17:19:47      阅读:580      评论:0      收藏:0      [点我收藏+]


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

bubuko.com,布布扣

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

bubuko.com,布布扣


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

bubuko.com,布布扣

最后一行代码改为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

Python3.3 input v.s. raw_input,布布扣,bubuko.com

Python3.3 input v.s. raw_input

原文:http://xjhznick.blog.51cto.com/3608584/1365232

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!