x = set([1, 2, 3, 4, 4, 5, 6, 7, 7])
y = set([3, 4, 5, 6, 7, 8, 9, 10])
for item in x.intersection(y):
    my_function(item)
x.remove(item)
y.remove(item)
python iterate over the two lists while comparing items