I have two lists with identical entries but different dates:

```
update = [[45, datetime.datetime(2019, 11, 14, 0, 0)], [42, datetime.datetime(2019, 11, 14, 0, 0)], [44, datetime.datetime(2019, 11, 13, 0, 0)]]

old = [[45, datetime.datetime(2019, 11, 13, 0, 0)], [42, datetime.datetime(2019, 11, 13, 0, 0)], [44, datetime.datetime(2019, 11, 13, 0, 0)]]

```

I want to add entries with an updated date to a new list. The desire output would look like this:

```
updated_urls = [[45, datetime.datetime(2019, 11, 14, 0, 0)],
                [42, datetime.datetime(2019, 11, 14, 0, 0)]]

```

However with my code:

```
updated_urls = []
for line in alt:
    for l in update:
        if line[0] == l[0]:
            if l[1] > line[1]:
                updated_urls.append(update)

```

I get this result:

```
update_urls=[[[45, datetime.datetime(2019, 11, 14, 0, 0)],
              [42, datetime.datetime(2019, 11, 14, 0, 0)]],
              [[45, datetime.datetime(2019, 11, 14, 0, 0)],
              [42, datetime.datetime(2019, 11, 14, 0, 0)]]]

```

I understand that I get this result because of the nested loop, but I cant think of a solution.
How can I solve this?