9 or 1 or 1 or ‘coding’
logic of its output ?
And or operator
Hello Shivam, the logic of its output is that if you know
And properties
0 & 0 = 0
0 & 1 = 0
1 & 0 = 0
1 & 1 = 1
Or properties
0 | 0 = 0
0 | 1 = 1
1 | 0 = 1
1 | 1 = 1
Now see there is concept of short circuiting in python and it is that if we evaluate the expressions and come to know about the result earlier without solving the full expression.
What I mean is that see if we have
8 & 6 & 2 & 1 & 9 Here it will have to solve the full result as it is possible that further on we can get any zero value or it can turn into zero as well.
And if we see
24 & 12 & 0 & 8 & 12
Here pls see that it will evaluate 24&12 first of all the ans will be 8 and then it will evaluate 8 and 0 then the output will be 0. Now the python language knows that we are doing & operation and there is no sense of doing & if we get the zero in that as now the overall result will evaluate in 0 itself. So it will break it between and leave the rest of the operations like 0 & 8 & 12.
As we know the ans of the whole expression.
Now we can see the same thing in terms of or operation.
As these operations evaluates in terms of the bits of the nos.
Now if we have an expression like
0 or 0 or 0 or False or 2 or 7 or 3
Then it will compute 0 or 0 or 0 or False and when it will compute 0 or 2 then the result will be 2 and python knows that the non zero ans is the preference of the or operation if at least one non zero element is there it the ans as it is non zero entity.
And if we have the expression like
0 or 0 or 0 or False or 0
then it will compute till the end in the search of the non zero no. and if there is not any then it will return 0 as the ans.
I hope it is clear to you. In case it is clear to you pls mark it as resolve and provide the rating as well as feedback so that we can improve ourselves.
In case there is still some confusion pls let me know, I will surely try to help you out.
Thanks 
Happy Coding !!