Вот код:
def converter_to_miles(): value = int(input('Значение:')) one_mile = 1.609 return round(value * one_mile, 1) def converter_to_km(): value = int(input('Значение:')) one_km = 0.621 return round(value * one_km, 1) def choice(): choice = str(input('Введите 1 для перевода киллометров в мили.\nВведите 2 для перевода милей в киллометр.\n ')) if choice == '1': print(converter_to_km()) elif choice == '2': print(converter_to_miles()) choice()