Python123:货币转换 I

在这里插入图片描述
在这里插入图片描述

tempstr = input("")
if tempstr[0:3] in ["RMB"]:
    C = tempstr[3:-1] + tempstr[-1]
    C = eval(C)/6.78
    print("USD{:.2f}".format(C))
else:
    F = tempstr[3:-1] + tempstr[-1]
    F = eval(F)*6.78
    print("RMB{:.2f}".format(F))

发布了105 篇原创文章 · 获赞 22 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/weixin_44652687/article/details/105206431