#2.2 CurrencyConvert.py
#coding = utf-8
CurrentNum = 6
Money = input("请输入带单位的货币金额(人民币用R表示,美元用D表示):")
while Money not in ["N","n"]:
if Money[-1] in ["R","r"]:
D = eval(Money[0:-1])/CurrentNum
print(Money[0:-1]+"人民币换算成美元为{:.2f}美刀".format(D))
elif Money[-1] in ["D","d"]:
R = eval(Money[0:-1])*CurrentNum
print(Money[0:-1]+"美元换算成人民币为{:.2f}元".format(R))
else:
print("您输入的格式有误!")
Money = input("请输入带单位的货币金额(人民币用R表示,美元用D表示):")
#2.2 CurrencyConvert.py
最新推荐文章于 2022-05-12 06:23:24 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)