0
Precedence of Logical operators.
What are the precedence of these logical operators( &&, ||, !, and, or, not) from lowest to highest order in Ruby and Python ?
3 Answers
+ 4
Go here and scroll down to 'Operator precedence'.
https://docs.python.org/3/reference/expressions.html
+ 2
Like if there is a situation like this :
if cond1 && cond2 or cond3 || cond4 and cond5:
In this situation how will be the conditions checked? Will cond4 and cond5 be checker first ?...or ...cond1 && cond2 ..?
+ 1
HonFu I checked it out, didn't get my answer completely... I wanted to know the precedence difference of the keywords( and, or, not) and the operators(&&, ||, !) as well if used in combination..but in their precedence table they only mentioned about the keywords.