# 打印字符串“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)
- Go back through and write a comment on what each line does.
- Read each one backward or out loud to find your errors.
- From now on, when you make mistakes, write down on a piece of paper what kind of mistake you made.
- When you go to the next exercise, look at the mistakes you have made and try not to make them in this new one.
- 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.