运行 ❯
获取您自己的
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 = f"The price is {x:F} dollars." print(txt) #same example, but with a lower case f: txt = f"The price is {x:f} dollars." print(txt)
价格为 INF 美元。
价格为 inf 美元。