I know that 'AND' is to give out a boolean value. eg:
x = 4
x > 3 and x < 5
It will output TRUE
But when the code is:
18 and 4
it will output 4. What does it mean?
I know that 'AND' is to give out a boolean value. eg:
x = 4
x > 3 and x < 5
It will output TRUE
But when the code is:
18 and 4
it will output 4. What does it mean?
If the operands of and/or were not boolean values (True/False)
>>> 5 and 6
6
>>> 6 and 5
5
>>> 0 and 2
0
>>> 0 or 2
2
>>> True and 2
2
>>> 2 and True
True