Skip to content
Question 64 of 97

Q.What will the following expression be evaluated to in Python? print(4+3*5/3-5%2)

(a) 8.5
(b) 8.0
(c) 10.2
(d) 10.0
Sikkim CbseCBSE Class XII Board 2023MCQ· 1mImportance★★★★★
66% · 64/97 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

Python evaluates 4 + 3 * 5 / 3 - 5 % 2 using operator precedence: *, /, % first (left to right), then +, - (left to right). The result is 8.0, so the answer is (b).

When Python evaluates an arithmetic expression it does not simply read left to right — it follows operator precedence (which operations happen first) and associativity (the order among operators of equal precedence). This is the same BODMAS/PEMDAS idea from mathematics.

The operators here rank as follows:

OperatorMeaningPrecedenceAssociativity
*MultiplicationHigherLeft to right
/DivisionHigherLeft to right
%Modulo (remainder)HigherLeft to right
+AdditionLowerLeft to right
-SubtractionLowerLeft to right

*, / and % share the same (higher) precedence, so they run left to right first; then + and - run left to right.

Step by step for 4 + 3 * 5 / 3 - 5 % 2:

  1. 3 * 5 = 15 → 4 + 15 / 3 - 5 % 2 …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.