Im a newbie to coding & have recently started learning python, Im trying to write a simple program to convert input weight to kilograms if entered in lbs and vice versa using if-else statement, Here's my code :
inwght = float(input("enter weight ")) #input weight
print("weight is in KG or LBS ")
unit1 = input("enter k for kg or l for lbs ") #asking for measuring units
if unit1 == "K" or "k" : #input is in kgs
weight1 = inwght*2.205
print(weight1)
elif unit1 == "l" or "L" : #input is in lbs
weight2 = inwght / 2.205
print(weight2)
else :
print("invalid output")
It does not give any errors, it successfully converts kg to lbs, but when i select unit as 'L' or 'l', i.e lbs, it still converts kgs to lbs and not the other way around, any corrections/corrections would be helpful Thanks