Question: I am trying to write a piece of code that plots a list of markers on a map.
The markers are formatted by longitude and latitude:

```
trip_markers[0:4]:

[[40.64499, -73.78115],
 [40.766931, -73.982098],
 [40.77773, -73.951902],
 [40.795678, -73.971049]]

```

I am trying to write a function that iterates through this list, and plots each point on a map.

```
def map_from(location, zoom_amount):
    return folium.Map(location=location, zoom_start=zoom_amount)

manhattan_map = map_from([40.7589, -73.9851], 13)

```

The code below seems to be the problem

```
def add_markers(markers, map_obj):
    for marker in markers:
        return marker and marker.add_to(map_obj)   

map_with_markers = add_markers(trip_markers, manhattan_map)

```

I expect my output of `map_with_markers` to produce a map with each point plotted

However I am getting:

```
<folium.vector_layers.CircleMarker at 0x7f453a365c50>

```

Answer: 
I suggest using *Linq*, [GroupBy](https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.groupby?view=netframework-4.8): 

```
using System.Linq;

...

// No Sequential Order test
var _entries = new List<string>() {
   "Awesom",
   "Bar",
   "Awesom",
   "Awesom",
   "Foo",
   "Awesom",
   "Bar",   
};

int count = _entries
  .GroupBy(item => item)    
  .Sum(group => group.Count() - 1);

```

with a help of `GroupBy` we obtain `3` groups:

```
4 items of "Awesom"
1 items of "Foo" 
2 items of "Bar"

```

then we can just `Count` items in each group and `Sum` them: `(4 - 1) + (1 - 1) + (2 - 1) == 4` duplicates overall.
When you say *This one compares in sequential order but it should compare with every possible scenario.* I believe you are expecting value of **count = 16**. As by comparing with every possible values you'll have 16 combinations and as all the values are equal you'll get count as 16.

```
            var _entries = new List<string>();

        _entries.Add("Awesom");
        _entries.Add("Awesom");
        _entries.Add("Awesom");
        _entries.Add("Awesom");

        var query = from e1 in _entries
                    from e2 in _entries
                    where e1 == e2
                    select $"{e1} x {e2}";
        var count = query.Count();

```

Try printing values of query variable and you'll see all combinations.