python字符串格式化方法

s='%d*%d=%d'%(1,2,3) 这是一种方法,据说以后主要采用format方法,使用方法如下: 1、按照默认顺序,不指定位置   print("{} {}".format("hello","world") )   hello world   2、设置指定位置,可以多次使用   print("{0} {1} {0}".format("hello","or"))   hello or hel
相关文章
相关标签/搜索