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

[python]print简单用法

时间:2015-11-20 15:37:52      阅读:169      评论:0      收藏:0      [点我收藏+]

标签:

python打印变量:

1.在Eclipse中输入:

print "Hello world!"

myString = "Hello world!"
print myString

运行结果:

Hello world!
Hello world!

 2.格式化字符串

print "%s is in the left of railway station %d" % ("huizhi", 2)

运行结果:

huizhi is in the left of railway station 2

 

[python]print简单用法

标签:

原文地址:http://www.cnblogs.com/sophia194910/p/4980824.html

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