运行 ❯
获取您自己的
Python 服务器
×
更改方向
更改主题,深色/浅色
前往 Spaces
#Use "F" to convert a number into a fixed point number, but display inf and nan as INF and NAN: x = float('inf') txt = "The price is {:F} dollars." print(txt.format(x)) #same example, but with a lower case f: txt = "The price is {:f} dollars." print(txt.format(x))
价格为 INF 美元。
价格为 inf 美元。