Question: ```
# FOR SETS
a=set([1,2,3])
b=set([4,5,6])

print(a and b) #always prints right side value that is b here
print(a or b) #always prints left side value that is a here
print(b and a)#prints a as its on right
print(b or a)#prints b as its on left

#FOR BOOLEANS
print(False and 0) #prints False as it is on the left
print(0 and False) #prints 0 , same operator is used than why diff output
print(False or '') #prints '' as it is on the right
print('' or False) #prints False as now it is on the right

print(1 or True) #prints 1
print(True or 1) #prints True
print(True and 1)#prints 1
print(1 and True)#prints True

```

AND always print the left side value and OR always prints the right side value for **False type of** boolean. Reverse happens with **True type of** boolean. 

When applied to **any number of** sets OR gives leftmost value and AND gives rightmost value. Why ?

Answer: 
The Python reference answers your question. <https://docs.python.org/2/reference/expressions.html#boolean-operations>

> 
> The expression `x and y` first evaluates `x`; if `x` is false, its value is
>  returned; otherwise, `y` is evaluated and the resulting value is
>  returned.
> 
> 
> The expression `x or y` first evaluates `x`; if `x` is true, its value is
>  returned; otherwise, `y` is evaluated and the resulting value is
>  returned.
> 
> 
> 

Values of container type (such as sets and lists) are considered false if they are empty, and true otherwise.
I don't think it's due to left or right side, but more of how and - or are evaluated.

First of all in python 0 is equal to False and 1 to True, but it is possible for True and False to be reassigned, but by default 0 == 0 or 0 == False are both True.

This said, you can now look how and - or operator condition are evaluated.

To summerise:
The *and* operator is always looking for a False (0) value, if he finds it on the first evaluated parameter then he stop, but if he finds True or 1 he had to evaluate the second condition to see if it's a False. Because False *and* someting else will always be false. This table might help you, look when i have 0 (False) answer is always 0 (False)

```
*and* truth table
0 0 = 0                  
0 1 = 0                  
1 0 = 0                  
1 1 = 1   

```

The *or* is a bit different but with same mechanic:
The *or* will look for the first True (1) he finds. So if he finds False first he will evaluate the second parameter, if he finds True (1) in first then he stops.
Here when you have a 1(True) answer is always 1(True) 

```
*or* truth table
0 0 = 0
0 1 = 1
1 0 = 1
1 1 = 1

```

You can look at other operator just google operator truth table and you will have a lot of other and more detailed exemple.

For your exemple:

```
#FOR BOOLEANS
print(False and 0) #prints False because *and* only need one False
print(0 and False) #prints 0 , because 0 = False and *and* only need one False
print(False or '') #prints '' because *or* is looking for a 1(True) but here both are False so he print the last one
print('' or False) #prints False (same reason as the one above) and he print the last one.

print(1 or True) #prints 1 because it's *or* and he found a True(1)
print(True or 1) #prints True same reason as above 1 = True so...
print(True and 1) #prints 1 because *and* is looking for a False and the first condition is True so he need to check the second one
print(1 and True) #prints True same as above 1 = True so and check for second paramater.

```