我剛剛制作了一個簡單的重量轉換器,可以從用戶那里獲取輸入并將其轉換為公斤或磅。我沒有收到任何錯誤,但我運行的代碼只是說以磅為單位的值而不是以千克為單位的值...請幫幫我...提前致謝
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
提交
取消