I generally just use sets: setA = set([1,2,3]) setB = set([2,3,4,5])
diff = setA - setB union = setA + setB diffAsList = list(diff) # In case you NEED to convert it back to a list... you can always just iterate like normal - Paul On Thu, Jun 11, 2009 at 11:38 AM, sberger<[email protected]> wrote: > > Hi guys, i would to know if there is already function in python to > perform list booleans. > > For example, given those list > listA = [1,2,3] > listB = [2,3,4,5] > > performing these operation would give the result > listB-listA would give [4,5] > > listA+listB would give [1,2,3,4,5] > > etc.. > > thanks > > > --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/python_inside_maya -~----------~----~----~----~------~----~------~--~---
