python四舍五入函数round的用法范例
print round(3.4) # 3 print round(3.5) # 4 print round(3.6) # 4 print round(3.6, 0) # 4 print round(1.95583, 2) # 1.96 print round(1241757, -3) # 1242000 print round(5.045, 2) # 5.05 print round(5.055, 2) # 5.06
python四舍五入函数round的用法范例
print round(3.4) # 3 print round(3.5) # 4 print round(3.6) # 4 print round(3.6, 0) # 4 print round(1.95583, 2) # 1.96 print round(1241757, -3) # 1242000 print round(5.045, 2) # 5.05 print round(5.055, 2) # 5.06