I'm trying to figure out why I'm unable to use parentheses and math logic within ELIF statements.
Code such as this will not work:
ELIF (A + B) / C = D
While this will:
ELIF A + B / C = D
Notice how the only difference is the parentheses. Values don't really matter, neither do the math operators or comparison operators. In fact, a comparison operator isn't even needed.
Naturally, this is mathematically different and will have different results.
For this specific case, we know that the following statements are equivalent and thus interchangeable...
(A + B) / C
A / C + B / C
...so I was able to clumsily maneuver around this issue, but it still begs the question of why this is prohibited in the first place.
Please sign in to leave a comment.