import statistics


def is_horizontal_way(list_nodes_values):
    """
    This function verifies if the way has more variance
    horizontally (longitude) or vertically (latitude).

    :param list_nodes_values:       list
                                    it contains tuples with lat and lon
                                    [(lat, lon)]

    :return: boolean                True if is a horizontal way, false
                                    if is not.
    """
    # create a list with all nodes latitudes
    lat = []
    for i in list_nodes_values:
        lat.append(i[1])

    # create a list with all nodes longitudes
    lon = []
    for i in list_nodes_values:
        lon.append(i[0])

    # verify the variance in latitude list
    variance_lat = statistics.variance(lat)

    # verify the variance in longitude list
    variance_lon = statistics.variance(lon)

    # if longitude has more variance, it is
    # a horizontal way
    if variance_lon > variance_lat:
        return True
    else:
        return False