标签:0.00 span col ... pytho div pre mat 保留
>>> a = 1 >>> b = 3 >>> print(a/b) 0 >>> #方法一: ... print(round(a/b,2)) 0.0 >>> #方法二: ... print(format(float(a)/float(b),‘.2f‘)) 0.33 >>> #方法三: ... print (‘%.2f‘ %(a/b)) 0.00 >>>
标签:0.00 span col ... pytho div pre mat 保留
原文地址:https://www.cnblogs.com/haiyan123/p/9104143.html