formatter = "%r %r %r %r"
print(formatter % (1,2,3,4))
print(formatter % ("one", "two", "three", "four"))
print(formatter % (True, False, True, False))
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."
))
output
1 2 3 4
‘one‘ ‘two‘ ‘three‘ ‘four‘
True False True False
‘%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.‘
2019-09-26
21:27:37
Exercise 8 - printing, printing
原文:https://www.cnblogs.com/petitherisson/p/11593212.html