def display_error_fields(fields):
    """format the display of missing fields"""
    num_fields = len(fields)
    if num_fields == 1:
        return fields[0]
    if num_fields == 2:
        return "{} and {}".format(fields[-2], fields[-1])
    #field length greater than 2
    return "{} and {}".format(",".join(fields[:-1]), fields[-1])