1+1*3==6. Is it yes or no. Someone help me | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

1+1*3==6. Is it yes or no. Someone help me

16th Jan 2017, 6:42 AM
seetha
seetha - avatar
18 Answers
+ 24
no 1*3=3 1+3=4
16th Jan 2017, 6:47 AM
Frost
Frost - avatar
+ 12
* has higher precedence, so the answer is 4.
16th Jan 2017, 6:48 AM
Karl T.
Karl T. - avatar
+ 7
Explanation : The Answer is No. Just always remember the law of PEMDAS P = Parenthesis E = Exponent M = Multiply D = Divide A = Add S = Subtract the logic on the computer always do the PEMDAS,or it start from the Left to right, or PARENTHESIS to SUBTRACT,,,. so the question is "why 1+1*3 is not equal to 6" the answer is, 3*1 = 3, then 3 + 1 = 4. The multiply is always the first before the addition.
17th Jan 2017, 10:18 AM
Darwin Fegarido
Darwin Fegarido - avatar
+ 4
now I got it 1+1*3==6 1+3==6 4==6 False
17th Jan 2017, 4:53 AM
Ajay Agrawal
Ajay Agrawal - avatar
+ 3
it's a no
16th Jan 2017, 6:45 AM
Amir Haghani
Amir Haghani - avatar
+ 3
thank qew sid
16th Jan 2017, 6:48 AM
seetha
seetha - avatar
+ 2
no it is prints False I have tried it on sololearn python. i don't understand why it is printing that because their is 1 also so it has to print "1 or true" atleast
17th Jan 2017, 4:43 AM
Ajay Agrawal
Ajay Agrawal - avatar
+ 2
Helioform, what about == operator? I think it's priority is more than * operator.
17th Jan 2017, 4:52 AM
Ajay Agrawal
Ajay Agrawal - avatar
+ 2
1×3=3 3+1=4 no
24th Jan 2017, 3:56 PM
박정호
박정호 - avatar
+ 1
I've written some code in code playground that helps explain answer to this and also covers how you can help figure out stuff like this, and how you can make the code do the addition first. I use comments (bits of text that are ignored by python, so that humans can put notes in the code for humans to read) in the code to explain everything, so read everything in there and then run it http://www.sololearn.com/app/python/playground/cpFOz8t1ZE2G/
17th Jan 2017, 2:13 PM
Phil
Phil - avatar
+ 1
it will be "No" as == has higher producer value then * or + so if 1+1 * 3==6: ###(false) ###(it is false because, interpreter will first execute == , in case it is false, it neglect the + and * operator;) print("Yes") ###(the if statement will get terminated and execute else statement) else: print("No") ###(so, no will be shown on screen)
1st Oct 2020, 6:18 PM
Muhammad Rukban Ali Yousaf
Muhammad Rukban Ali Yousaf - avatar
0
No
18th Jan 2017, 4:14 AM
Ishwor Subedi
Ishwor Subedi - avatar
0
It is definitely "No" because at this point the lesson teaches that "==" has a higher precedence than "or". So if you do the math you'll see that the calculation is 1+1*3==6 --> 4==6 (which is False), this means that the "else" statement will be printed. You can try it in Code playground or in Python IDE if you're using a computer. Good luck!
18th Jan 2017, 8:06 PM
Hakob Baghdasaryan
Hakob Baghdasaryan - avatar
0
no
25th Jan 2017, 4:53 PM
maharjan
maharjan - avatar
0
It would be false because multiplication comes before adding. Try putting 1 + 1 in parenthesis and then run it. It should print True.
1st Mar 2017, 3:14 AM
Garrison
0
(1+1)*3=6 1+(1*3)=3 u should define brackets to get correct solution
18th Aug 2017, 7:32 PM
Harish Perni
Harish Perni - avatar
- 3
how.. 6==6.. its yes only know
16th Jan 2017, 6:46 AM
seetha
seetha - avatar
- 3
Yes its right according synergy
17th Jan 2017, 12:05 PM
Rock star
Rock star - avatar