am a bit confused about this operator precedence | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

am a bit confused about this operator precedence

1+1*3==6 according to the order or precedence + comes before * Then (1+1)*3==6 2*3==6 6==6 Then the result would have been Print("yes") But thats not it Pls someone help me out

20th Dec 2019, 10:08 AM
Dami
Dami - avatar
2 Answers
+ 2
What we are talking about? Python? Python's order of operations is the same as that of normal mathematics: parentheses first, then exponentiation, then multiplication/division, and then addition/subtraction. But how ever, NEVER comes + before * In none languages in the world. So in this case multiplication first. 1*3 =3 1+3 =4 4 != 6
20th Dec 2019, 10:15 AM
Coding Cat
Coding Cat - avatar
0
ok thanks, I thought I saw that on the table
20th Dec 2019, 10:21 AM
Dami
Dami - avatar