我刚刚制作了一个简单的重量转换器,可以从用户那里获取输入并将其转换为公斤或磅。我没有收到任何错误,但我运行的代码只是说以磅为单位的值而不是以千克为单位的值...请帮帮我...提前致谢
1 回答
慕森卡
TA贡献1806条经验 获得超8个赞
weight=int(input("Ceki gir : "))
kg=weight*2.20
lbs=weight/2.20
type1=input("K for kG P for p ")
if type1=="P" or type1=="p":
print("Your weight is: ",lbs)
elif type1=="K" or type1=="k":
print("Your weight is: ",kg)
else:
print("Wrong")```
I wrote like this and i think it is worked u can try and tell me if it is worked or not
添加回答
举报
0/150
提交
取消