I just start learning python. I built a basic weight converter which can convert weight kilo to pound or pound to kilo. I have two input field. I want only accept value "L" or "K" in first input filed if user give wrong input then it will show the error massage like "please choose between k or L" and I also want if user give any string value in second input field then it will show a error massage like "please enter number. You given string"
here is my code:
unit = input("Select (K)kilograms or (L)pounds: ").upper()
if unit == "L":
weight = int(float(input("give your weight: ")))
converted_weight = weight * 0.45
print(f"your weight {converted_weight} converted to kilograms")
elif unit == "K":
weight = int(float(input("give your weight: ")))
converted_weight = weight / 0.45
print(f"your weight {converted_weight} converted to pounds")