1 代码:
?
2 运行结果:
3 其中字符串形式的:print(‘%.2f‘ % (x/y))方式最好
python保留2位小数
原文:https://www.cnblogs.com/finer/p/11105527.html