[python] 字符串引用

%s  str

%d  整数

%f  浮点数

print('$%.03f' % 30.1777)

>>>$30.178  #四舍五入

print( '%-5s %s %10s' % ('John','every','man') )

>>>John     every          man

原文地址:https://www.cnblogs.com/jt-huang/p/3627643.html