这个代码哪里错了
python吧
全部回复
仅看楼主
level 5
—云隙微光—
楼主
为什么我一直改不对呢,求教
2026年03月10日 13点03分
1
吧务
level 12
一周休七日
看不到题目的输入输出要求
2026年03月10日 15点03分
2
—云隙微光—
吧主,完整的我发帖子底下了
2026年03月10日 15点03分
—云隙微光—
可以看看嘛
2026年03月10日 15点03分
level 5
—云隙微光—
楼主
2026年03月10日 15点03分
3
level 11
覆万峻
if改成¥和$
2026年03月10日 15点03分
4
—云隙微光—
对,我尝试过了,对了一半🥵
2026年03月10日 16点03分
level 2
比企谷十幡
输出格式有点问题,如果输入的是整型的话由于你的num取了浮点型所以会变成浮点数
2026年03月11日 11点03分
5
level 1
信仰的君,拯救的主
不知道,我不会
2026年03月13日 03点03分
6
—云隙微光—
2026年03月13日 03点03分
信仰的君,拯救的主
2026年03月13日 10点03分
—云隙微光—
2026年03月13日 10点03分
信仰的君,拯救的主
@—云隙微光—
不许回了,你一回我就想回
你再回我就私信去骚扰你
2026年03月13日 11点03分
level 8
sunruisunrui
可以私信
2026年03月13日 16点03分
7
level 8
sunruisunrui
def change(money):
rate = 6.71
if money[0] == '$':
n = float(money[1:])
r = n * rate
print(f"{int(n)}美元 = {r:.2f}人民币")
elif money[0] == '¥':
n = float(money[1:])
r = n / rate
print(f"{int(n)}人民币 = {r:.2f}美元")
2026年03月13日 16点03分
8
level 8
sunruisunrui
2026年03月13日 16点03分
9
1