当前位置:   article > 正文

Python 学习笔记_rint('%s,%s,%s,"%"' %

rint('%s,%s,%s,"%"' %

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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/989916
推荐阅读
相关标签
  

闽ICP备14008679号