THanks Gabriel,
Now I know about the zip function.

Your explanation of Boolean ops on lists was clear.
It leads to some intriguing results:

bool([False])
--> True

I wonder if python 3 changes any of this?

> A and B means: check the boolean value of A; if it's false, return A.  
> Else, return B.
> A non-empty list has a boolean value of true, so the second list is  
> returned.
>
> If you want an element-wise operation:
> A = [False,True]
> B = [True,True]
> result = [a and b for a,b in zip(A,B)]
> --
> Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to