0
The codes attached have almost the same pattern ..but why their answers are different ..amd also please explain the answers
2 Respuestas
+ 7
print(1+1 or 1*3 == 6)
print(9*2 and 32 == 4*8)
In both the examples you are performing logical operations on numbers and boolean variable.
The logical reason behind getting 2 and true is because-
Any false value OR with number will give result as number.
Any true value AND with number will give result as True.
I hope it helps. Let me know if you still don't get it.
0
@Apoorva shenoy Nayak why is it so?