编程语言
首页 > 编程语言> > 笨办法学Python第九天:打印,打印

笨办法学Python第九天:打印,打印

作者:互联网

编辑以下内容:

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."
)

会看到以下结果:

注意最后一行程序中既有单引号又有双引号,你觉得它是如何工作的?我们思考一下。

标签:第九天,False,Python,打印,print,formatter,True
来源: https://blog.csdn.net/qq_33117229/article/details/121319296