I am brand new to python and I am trying to make a little unit conversion program.
So here is a portion of my code.
choicek = int(input(f"Enter Kilograms: ") if choice == "1" else exit)
Kilorate = 2.2046
answerK = choicek *Kilorate
print(round(answerK, 2))
choicep = int(input(f"Enter Pounds: ") if choice == "2" else exit)
Poundrate = 2.2046
answerP = choicep/Poundrate
print(round(answerP, 2))
choicel = int(input(f"Enter Liters: ") if choice == "3" else exit)
Literrate = 3.785412
answerL = choicel/Literrate
print(round(answerL, 2))
choiceg = int(input(f"Enters Gallons: ") if choice == "4" else exit)
Gallonrate = 3.785412
answerG = choiceg * Gallonrate
print(round(answerG, 2))
Sorry for that mess, anyways. The problem I am having is that if I do not input 1, then the program exits. I understand that it is this way because I am telling it "If 1 is not typed in, then exit the program". But I want it to be so that I can put 1 or 2 or 3 or 4.
Is there another way I can write this without having to put exit at the end of the If statement? Any advice would be appreciated, and again I am very new to this.