#coding: utf-8
# Here's some new strange stuff, remember type it exactly.
days = "Mom Tue Wed Thu Fri Sat Sun" #定义一串字符串到days变量中
months = "Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug" #这里注意转义符\后面加不同字母表示不同含义,\n表示换行
print "Here are days:", days
print "Here are 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.
""" #如引号中所说,连续三个引号的“大引号”之间可以插入任意行的文字(注意引号之间不能空格)
# 注意\方向别反了,还有就是%r时再使用\n就不灵了,因为%r输出的是原始内容,用来调试
ex9.py 打印,打印,打印
最新推荐文章于 2024-01-22 21:42:34 发布