python 字符串格式化输出

方法1、使用(%s %d %f ) 格式化输出

例子:

方法2、使用( format )格式化输出

例子: 

   

方法3、使用简写( f )格式化输出

例子: 

拓展:数据保留n位小数输出的3种写法,

猜你喜欢

转载自blog.csdn.net/m0_73485816/article/details/128448195