I have two lists of Bools in python:
l1 = [True, False, True]
l2 = [False, True, True]
And I wish to do elemental-wise comparison And/Or for them. I wish to get:
l3 = [False, False, True] # elemental-wise And
l4 = [True, True, True] # elemental-wise Or
So I simply put:
l3 = l1 and l2
l4 = l1 or l2
But the result behaves unexpectedly as:
l3=[False, True, True] (which is l2)
l4=[True, False, True] (which is l1)
How can I accomplish the elemental-wise comparison nice and clean?