python format保留小数标签:python 代码: print(format(2.34567, '.2f')) print(format(2.34567, '.3f')) print(format(2.34567, '.4f')) 2.35 2.346 2.3457