I have 2 variables: x="null"
and y=3
Following which I execute the command below:
if(x and y):
print 'True'
Output:True
I am looking for guidance to understand this behavior better.
The answer to this question fixed my issue Most elegant way to check if the string is empty in Python?
But I want to understand the behavior of this. I want to know how an AND
of "null"
and a numeric value of 3
returns in 3
which in turn results in truthify
value.