# Conversion utility problem # Function to return valid input def GetInput(): ValidInput = False # Validation while not ValidInput: Number = input(": ") # Type check if Number.isnumeric(): ValidInput = True if not ValidInput: print("Invalid input.") return int(Number) # Subroutine to convert feet to inches def FeetToInches(): print("Enter the number of feet.") Feet = GetInput() Inches = Feet * 12 print("{} feet is {:.2f} inches".format(Feet, Inches)) # Subroutine to convert inches to feet def InchesToFeet(): print("Enter the number of inches.") Inches = GetInput() Feet = Inches / 12 print("{} inches is {:.2f} feet".format(Inches, Feet)) # Subroutine to offer the conversion choice to the user def Menu(): MenuChoice = 0 # Iterate until quit is chosen while MenuChoice != 3: print("1. Feet to inches") print("2. Inches to feet") print("3. Quit") MenuChoice = GetInput() # Action menu choice if MenuChoice == 1: FeetToInches() elif MenuChoice == 2: InchesToFeet() elif MenuChoice == 3: print("Goodbye.") else: print("Invalid input.") print("-------------------------") # Main program Menu()