I want to do something similar to this:

>>> x = [1,2,3,4,5,6,7,8,9,0]  
>>> x  
[1, 2, 3, 4, 5, 6, 7, 8, 9, 0]  
>>> y = [1,3,5,7,9]  
>>> y  
[1, 3, 5, 7, 9]  
>>> y - x   # (should return [2,4,6,8,0])

But this is not supported by python lists
What is the best way of doing it?

15 Answers
15

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *