Can someone explain me the operator precedence? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can someone explain me the operator precedence?

why this happen? >>> False == False or True True >>> False == (False or True) False >>> (False == False) or True True

28th Dec 2016, 1:23 PM
Julieta Rossi
Julieta Rossi - avatar
2 Answers
+ 2
1st case: it's true that false equals false so the subsequent or statement is met and the result is true as the equation looks like True or True 2nd case the or statement is met because one of the conditions is true. the final result is false as the equation looks like False==True 3rd case is equivalent to the 1st case and after checking that is true that false equals false, the or statement is met as the final equation looks like True or True. As a rule of thumb solve first the operations enclosed in brackets and later on, the rest always taking care of operators precedence (* and / come before + and -)
28th Dec 2016, 1:34 PM
seamiki
seamiki - avatar
+ 1
thank you very much!
28th Dec 2016, 1:37 PM
Julieta Rossi
Julieta Rossi - avatar