题目四
代码
n = input('请输入带有标志(RMB,USD)的钱数:')if n[:3] in ['RMB']: u = eval(n[3:]) / 6.78 print("USD{:.2f}".format(u))elif n[:3] in ['USD']: r = 6.78 * eval(n[3:]) print("RMB{:.2f}".format(r))
运行结果
传送门: 题目总目录
来源地址:https://blog.csdn.net/qq_52855464/article/details/126908897