exercise 7

# 打印字符串“Mary had a little lamb.”
print("Mary had a little lamb.")
# 打印字符串“Its fleece was white as show.”
print("Its fleece was white as {}.".format('show'))
# 打印“And every where tha Mary went.”
print("And everywhere that Mary went.")
# 使“.”号重复十遍
print("."*10)   #what'd that do?

# 接下来的11~22行是赋值
end1 = "C"
end2 = "h"
end3 = "e"
end4 = "e"
end5 = "s"
end6 = "e"
end7 = "B"
end8 = "u"
end9 = "r"
end10 = "g"
end11 = "e"
end12 = "r"

# watch end = '' at the end. try removing it to see what happens
# 我在实验下面的函数过程中并通过查找资料发现,print()函数有两个参数——sep和end参数,下面就是用到了end参数。
# print()函数中的逗号默认用空格代替,末尾默认加上换行符。其中sep是代替分隔符,end是代替末尾的换行符。
print(end1 + end2 + end3 + end5 + end6 , end = ' ')
print(end7 + end8 + end9 + end10 + end11 + end12)
  1. Go back through and write a comment on what each line does.
  2. Read each one backward or out loud to find your errors.
  3. From now on, when you make mistakes, write down on a piece of paper what kind of mistake you made.
  4. When you go to the next exercise, look at the mistakes you have made and try not to make them in this new one.
  5. Remember that everyone makes mistakes. Programmers are like magicians who fool everyone into thinking they are perfect and never wrong, but it's all an act. They make mistakes all the time.
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 10,030评论 0 23
  • 方言好,难觅是乡音。 纵使俗话牵魂梦,虽是白语惹旧情。 哪堪离别景?
    于经纬阅读 302评论 0 0
  • 2017年2月5日 Brisbane 晴 今天是在Stamford的Last Day,扫完所有房间,脱掉制服,将在...
    Xwlllllll阅读 273评论 0 0
  • 文/乐天 凿井惊天兵,虎狼震幽冥。 千军千异面,万乘轰雷霆。 气吞秦塞固,威憾九州城。 五巡登群岳,丰碑立刻功。 ...
    凯歌儿阅读 118评论 2 4
  • 三月, 乍暖还寒。 向阳坡的草儿绿了, 角落残留着寒冬的冰雪。 风筝带着孩童的梦想高飞, 春风吹不开凝固的心情。 ...
    刘晓松阅读 262评论 0 3