首页 > 编程语言 > 详细

Learn Python The Hard Way(9)

时间:2015-04-14 20:23:53      阅读:496      评论:0      收藏:0      [点我收藏+]
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Here‘s some new strange stuff, remember type it exactly.
days = "Mon Tue Wed Thu Fri Sat Sun"
months = "Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug"
print "Here are the days: ", days
print "Here are the months: ", months
print """
There‘s something going on here.
With the three double-quotes.
We‘ll be able to type as much as we like.
Even 4 lines if we want, or 5, or 6...
"""

输出结果:

                 技术分享

代码中‘\n’换行符,"""是输出多行字符串

Learn Python The Hard Way(9)

原文:http://my.oschina.net/xtfjt1988/blog/401518

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