我剛剛制作了一個(gè)簡(jiǎn)單的重量轉(zhuǎn)換器,可以從用戶那里獲取輸入并將其轉(zhuǎn)換為公斤或磅。我沒(méi)有收到任何錯(cuò)誤,但我運(yùn)行的代碼只是說(shuō)以磅為單位的值而不是以千克為單位的值...請(qǐng)幫幫我...提前致謝
1 回答
慕森卡
TA貢獻(xiàn)1806條經(jīng)驗(yàn) 獲得超8個(gè)贊
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
添加回答
舉報(bào)
0/150
提交
取消
