摘要: #-*- coding:utf-8 -*- days = "mon Tue Wed Thu Fri Sat Sun" months = "Jan\vFeb\vMar\vApr\vMay\vJul\nJul\nAug" #开始熟悉转义序列的用法 这里用到的是\n ASCII 换行符 #\v ASCII 垂直制表符 print ("here are the days: ", days) p... 阅读全文
posted @ 2016-11-15 13:36 听风呤 阅读(114) 评论(0) 推荐(0) 编辑
摘要: # -*- coding:utf-8 -*- formatter = "%s %s %s %s" #理解%s 和%r 输出时的不同 print (formatter % (1,2,3,4)) #python3.x与python2.x有一点区别,原来%(变量名,...)应该是加在print括号里 #如:print("who is the murder? %s or %s" % (a, b)... 阅读全文
posted @ 2016-11-15 13:35 听风呤 阅读(100) 评论(0) 推荐(0) 编辑
摘要: # -*- coding:utf-8 -*- print ("Mary had a little lamb.") print ("its fleece was white as %s." % 'snow') print ("And everywhere that Mary went.") print ("+" * 1000 )# what'd that do? 这句话的写法要了解 end1 ... 阅读全文
posted @ 2016-11-15 13:34 听风呤 阅读(128) 评论(0) 推荐(0) 编辑