Citation :
>>> diff= lambda x,y: [i for i in x if i not in y]
>>> diff(range(10), range(5, 15))
[0, 1, 2, 3, 4]
>>> diff= lambda x,y: [i for i in x if i not in y]
>>> diff(range(10), range(5, 15))
[0, 1, 2, 3, 4]
>>> import sets
>>> sets.Set(range(10)).difference(sets.Set(range(5, 15)))
Set([0, 1, 2, 3, 4])
|