wonderful... thanks i didn't find that set class.It is freaking sweet!

listA = [1,2,3]
listB = [2,3,4,5]
setB.difference(set(listA))
# Result: set([4, 5]) #
setB.symmetric_difference(set(listA))
# Result: set([1, 4, 5]) #

This rock, exactly what I needed

Thanks for the extremely quick answer


On Thu, Jun 11, 2009 at 2:44 PM, chadrik <[email protected]> wrote:

>
> check out the builtin 'set' class
>
> -chad
>
>
>
> On Jun 11, 2009, at 11:38 AM, sberger 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
> > >
>
>
> >
>


-- 
They say, "Evil prevails when good men fail to act." What they ought to say
is, "Evil prevails."
Nicolas Cage as Yuri Orlov in Lord of War.

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/python_inside_maya
-~----------~----~----~----~------~----~------~--~---

Reply via email to