I have two lists. One is simply a list of ids
ids = [123, 124, 127, 316, 463]
and the other is a list of tuples of id's and names
combined = [(123, "Brian"), (124,"Eric"), (222,"Jane")]
What is the easiest way to do set comparisons on these? I need to find out two things - ids that exist in the first list that don't appear in the second list, specifically 127, 316, 463
and vice versa, which would be (222, "Jane")
.
I am using Python 2.5.