小编Mik*_*yce的帖子

如何在python中打印十进制值

print("enter start() to start the program")

def start():
    print("This script converts GBP into any currency based on the exchange rate...")
    print(" ") #enters a line
    exchangeRate = int(input("Enter the exchange rate (Eg: 0.80)"))
    print("how much would you like to convert???")                       
    gpb = int(input())
    print(gpb*exchangeRate)
Run Code Online (Sandbox Code Playgroud)

如果我将汇率设为0.81而我输入£1则总是返回0.

python decimal floating-accuracy

4
推荐指数
1
解决办法
2826
查看次数

标签 统计

decimal ×1

floating-accuracy ×1

python ×1