I am working with two columns. One has a few individual numbers and the other has sums. I'd like to match up list1 and list2. At each iteration, I remove the numbers that were matched up. There will not necessarily be a match for all numbers, but I'd like to get as many as possible. How do I make sure the loop continues to iterate but terminates once all matches have been made?

Ideally, in the example below, I would like to end up with something like:

[5,6], 11\n
[2,3], 5

Of course, if the whole approach is incorrect, please feel free to advise.

Thank you for your kind help.

```
import itertools

list1=[5,6,2,3,8,7]
list2=[11,5]

combos=list(itertools.combinations(list1, 2))

for i in range(len(list1)):
    if sum(combos[i]) in list2:
        list1.remove(combos[i][0])
        list1.remove(combos[i][1])
        list2.remove(sum(combos[i]))
        combos=list(itertools.combinations(list1, 2))
        print(combos[i])

```