You can use sets:

```python
>>> nodes_in_use = set([1, 2, 3])
>>> held_nodes = set([4, 5, 2])
>>> nodes_to_remove = held_nodes - nodes_in_use
>>> nodes_to_remove
set([4, 5])
```