摘要: 1、保留小数点后两位 >>> print("{:.2f}".format(3.1415)) 3.14 2、带符号保留小数点后两位 >>> print("{:+.2f}".format(-3.1415)) -3.14 3、不带小数点 >>> print('{:.0f}'.format(2.7)) 3 阅读全文
posted @ 2021-01-22 15:57 十一的杂文录 阅读(895) 评论(0) 推荐(0) 编辑