def input_menu(options, input_text="Choose an option: "):
    """
    Input loop for selecting an option in a menu. Given a list of strings that represent the options on this
    menu, this will prompt for input, and loop back around if a non-integer value is entered or a value that
    doesn't correspond to a menu option. Once a valid value is entered, it is returned as an integer.
    :param options: A list of strings that will be enumerated and displayed as options.
    :param input_text: The text the appears as the prompt for user input. This defaults to "Choose an option: ".
    :return: The valid number that was entered as an integer.
    """
    while True:
        print()
        for option_idx in range(1, len(options)+1):
            print("{}: {}".format(option_idx, options[option_idx-1]))
        user_input = input(input_text)
        try:
            user_int = int(user_input)
            if user_int < 1 or user_int > len(options):
                print("Invalid input.")
            else:
                return user_int
        except ValueError:
            print("Invalid input.")