欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

習(xí)題 8: 打印,打印?

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
formatter = "%r %r %r %r"

print formatter % (1, 2, 3, 4)
print formatter % ("one", "two", "three", "four")
print formatter % (True, False, False, True)
print formatter % (formatter, formatter, formatter, formatter)
print formatter % (
    "I had this thing.",
    "That you could type up right.",
    "But it didn't sing.",
    "So I said goodnight."
)

你應(yīng)該看到的結(jié)果?

$ python ex8.py
1 2 3 4
'one' 'two' 'three' 'four'
True False False True
'%r %r %r %r' '%r %r %r %r' '%r %r %r %r' '%r %r %r %r'
'I had this thing.' 'That you could type up right.' "But it didn't sing." 'So I said goodnight.'
$

加分習(xí)題?

  1. 自己檢查結(jié)果,記錄你犯過的錯誤,并且在下個練習(xí)中盡量不犯同樣的錯誤。
  2. 注意最后一行程序中既有單引號又有雙引號,你覺得它是如何工作的?

Project Versions

Table Of Contents

Previous topic

習(xí)題 7: 更多打印

Next topic

習(xí)題 9: 打印,打印,打印

This Page