赞
踩
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."
)
#%r 换成 %s 绝对引用换成值引用。
formatter = "%s %s %s %s"
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."
)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。