I'm trying to make this statement to evaluate to be true using parentheses. I have tried multiple combinations but it always evaluates out to be false
2 + 3 == 4 + 5 == 7
I'm trying to make this statement to evaluate to be true using parentheses. I have tried multiple combinations but it always evaluates out to be false
2 + 3 == 4 + 5 == 7
False
is considered to be 0
, and True
is considered to be 1
, so it should be:
(2 + (3 == 4) + 5) == 7
Since False
is 0
, the 3 == 4
part would evaluate to 0
. Because of this, the expression would be the equivalent of:
(2 + 0 + 5) == 7
which would evaluate to True