a = 1000
b = 100
percent=float(b)*100/float(a)
print ("%.2f%%" %percent)
执行结果:
10.00%
计算百分比
猜你喜欢
转载自blog.51cto.com/daimalaobing/2125979
今日推荐
周排行