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.")
# 使“.”號(hào)重復(fù)十遍
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
# 我在實(shí)驗(yàn)下面的函數(shù)過程中并通過查找資料發(fā)現(xiàn),print()函數(shù)有兩個(gè)參數(shù)——sep和end參數(shù),下面就是用到了end參數(shù)。
# print()函數(shù)中的逗號(hào)默認(rèn)用空格代替,末尾默認(rèn)加上換行符。其中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.
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

推薦閱讀更多精彩內(nèi)容

  • **2014真題Directions:Read the following text. Choose the be...
    又是夜半驚坐起閱讀 9,900評(píng)論 0 23
  • 方言好,難覓是鄉(xiāng)音。 縱使俗話牽魂夢(mèng),雖是白語惹舊情。 哪堪離別景?
    于經(jīng)緯閱讀 291評(píng)論 0 0
  • 2017年2月5日 Brisbane 晴 今天是在Stamford的Last Day,掃完所有房間,脫掉制服,將在...
    Xwlllllll閱讀 267評(píng)論 0 0
  • 文/樂天 鑿井驚天兵,虎狼震幽冥。 千軍千異面,萬乘轟雷霆。 氣吞秦塞固,威憾九州城。 五巡登群岳,豐碑立刻功。 ...
    凱歌兒閱讀 116評(píng)論 2 4
  • 三月, 乍暖還寒。 向陽坡的草兒綠了, 角落殘留著寒冬的冰雪。 風(fēng)箏帶著孩童的夢(mèng)想高飛, 春風(fēng)吹不開凝固的心情。 ...
    劉曉松閱讀 260評(píng)論 0 3