Could you please explain me how and works in python? I know when
x y and
0 0 0 (returns x)
0 1 0 (x)
1 0 0 (y)
1 1 1 (y)
In interpreter
>> lis = [1,2,3,4]
>> 1 and 5 in lis
output gives FALSE
but,
>>> 6 and 1 in lis
output is TRUE
how does it work?
what to do in such case where in my program I have to enter if condition only when both the values are there in the list?