The output of print(3 + 4 * 2) in Python is:
-
A
14
-
B
11
Correct answer
-
C
24
-
D
9
14 views
Explanation
Multiplication is evaluated before addition. So 4 * 2 = 8, then 3 + 8 = 11. Working left to right gives 14, which is wrong.
Reference
Asked in: Matric,FBISE
Doubts & discussion
Not sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ