码迷,mamicode.com
首页 > 编程语言 > 详细

Python的输入

时间:2017-05-11 17:07:25      阅读:140      评论:0      收藏:0      [点我收藏+]

标签:print   问题   logs   color   style   span   python3   字符串拼接   world   

在python2.x里的raw_input()和python3.x里的input()是一样的。

# 在python2.x里
str = raw_input("hello world!")
print str
显示结果:hello world!

# 在python3.x里
str = input("hello world!")
print(str)
显示结果:hello world!

引申字符串拼接问题

Python的输入

标签:print   问题   logs   color   style   span   python3   字符串拼接   world   

原文地址:http://www.cnblogs.com/boreassun/p/6841489.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!