-1
我正在制作一个百分比查找器,非常基本。但是,我只想在float或int中打印4个字符。谁能帮忙? 这里是我到目前为止的代码:如何在Python中打印一定数量的字符数
numer = int(input("What's the numerator?"))
denom = int(input("What's the denominator?"))
percent = (numer/denom * 100, "%")
print(percent)
我想要的输出5/6是:
83.33%
但实际打印:
83.33333333333334%
谢谢!有效! –