def format_names(name_list: list):
    """
    Takes a list and returns a string formatting every string inside said list.

    For example, ['john', 'jane', 'joe'] would become "john, jane and joe"
    """
    name_count = len(name_list) - 1
    names = ""
    for idx, name in enumerate(name_list):
        if idx == 0:
            # First name
            names = name
        elif idx == name_count:
            # Last name
            names = names + " and " + name
        else:
            # A name.
            names = names + ", " + name
    return names