笨办法学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."
)

会看到以下结果:

笨办法学Python第九天:打印,打印注意最后一行程序中既有单引号又有双引号,你觉得它是如何工作的?我们思考一下。

上一篇:让 echarts 柱状图 label 根据柱高度自适应显示在柱内/柱外


下一篇:Java中在数字前自动补零方法