def print_menu(title, list_options):
    """Prints options in standard menu format like this:

    Main menu:
    (1) Store manager
    (2) Human resources manager
    (3) Inventory manager
    (0) Exit program

    Args:
        title (str): the title of the menu (first row)
        list_options (list): list of the menu options (listed starting from 1, 0th element goes to the end)
    """
    print(f'{title}:\n')
    # print(f'{option}\n' for option in list_options)
    for index, option in enumerate(list_options):
        print(f'({index + 1}){option}')


print_menu('Menu', ['Store manager', 'Human resources manager',
                    'Inventory manager', 'Exit program'])  # !


def print_message(message):
    """Prints a single message to the terminal.

    Args:
        message: str - the message
    """
    print(message)


lst = {'name': 'ionel', 'key': 'value'}
label = 'title'


def print_general_results(result, label):
    """Prints out any type of non-tabular data.
    It should print numbers (like "@label: @value", floats with 2 digits after the decimal),
    lists/tuples (like "@label: \n  @item1; @item2"), and dictionaries
    (like "@label \n  @key1: @value1; @key2: @value2")
    """
    print('\n' + label + ':')
    if isinstance(result, type(list())) or isinstance(result, type(tuple())):
        for item in result:
            print(item, end='; ')
        print('\n')
    elif isinstance(result, type(dict())):
        for keys, values in result.items():
            print(keys + ": " + str(values), end='; ')
        print('\n')
    else:
        print(result)
        print('\n', end="")

# /--------------------------------\
# |   id   |   product  |   type   |
# |--------|------------|----------|
# |   0    |  Bazooka   | portable |
# |--------|------------|----------|
# |   1    | Sidewinder | missile  |
# \--------------------------------/


def print_table(table):
    """Prints tabular data like above.

    Args:
         table: list of lists - the table to print out
    """

    col_max = []
    for i in range(len(table[0])):
        maxim = 0
        for j in range(len(table)):
            if len(table[j][i]) > maxim:
                maxim = len(table[j][i])
        col_max.append(maxim)
    total = sum(col_max) + 3 * len(col_max)
    print('/' + '-' * total + '\\')

    for index, row in enumerate(table):
        printed_row = ''
        for index_item, item in enumerate(row):
            if len(item) < col_max[index_item]:
                item += ' ' * (col_max[index_item] - len(item))
            printed_row += '| ' + item + ' '
        printed_row += ' |'
        print(printed_row)
        if index < len(table) - 1:
            print('|' + '-' * total + '|')

    print('\\' + '-' * total + '/')


# table = [
#     ['id', 'product', 'type'],
#     ['0', 'bazooka', 'portable'],
#     ['1', 'slidewinder', 'missile']
# ]

# print_table(table)


def get_input(label):
    """Gets single string input from the user.

    Args:
        label: str - the label before the user prompt
    """
    result = input(label)
    return result


def get_inputs(labels):
    """Gets a list of string inputs from the user.

    Args:
        labels: list - the list of the labels to be displayed before each prompt
    """
    result = []
    for item in list(labels):
        get_input = input(labels)
        result.append(get_input)
    return result


def print_error_message(message):
    """Prints an error message to the terminal.

    Args:
        message: str - the error message
    """
