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

笨办法学python习题7

时间:2018-11-15 18:30:55      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:removing   and   HERE   ever   little   AMM   插入   mat   white   

1.注释

 1 #打印Mary had a little lamb.
 2 print("Mary had a little lamb.")
 3 #在Its fleece was white as后插入字符串snow,并且打印
 4 print("Its fleece was white as {}.".format(snow))
 5 #打印And everywhere that Mary went.
 6 print("And everywhere that Mary went.")
 7 #打印10个“.”:..........
 8 print("."*10) #What‘d that do?
 9 
10 #w为end1-12分别赋值
11 end1 = "C"
12 end2 = "h"
13 end3 = "e"
14 end4 = "e"
15 end5 = "s"
16 end6 = "e"
17 end7 = "B"
18 end8 = "u"
19 end9 = "r"
20 end10 = "g"
21 end11 = "e"
22 end12 = "r"
23 
24 # watch that camma at the end. try removing it to see what happens
25 #将end1-6合并,加空格,打印
26 print(end1 + end2 + end3 + end4 + end5 + end6, end =  )
27 #将end7-12合并,打印
28 print(end7 + end8 + end9 + end10 + end11 + end12)

* end = ‘  ‘ 能在末尾添加空字符串

笨办法学python习题7

标签:removing   and   HERE   ever   little   AMM   插入   mat   white   

原文地址:https://www.cnblogs.com/shadowyuriya/p/9964767.html

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