Skip to content
Question 75 of 97

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

(a) 6.5
(b) 4.0
(c) 6.0
(d) 4
Odisha ChseCBSE Class XII Board 2023MCQ· 1mImportance★★★★★
77% · 75/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 →

6/3 + 4**3//8 - 4 evaluates as 2.0 + 8 - 4 = 6.0 — a float, because / in Python 3 always returns a float. Correct option: (c) 6.0.

Concept — precedence and result types

Two rules decide this question:

  1. Precedence: ** (exponent) binds tightest; then / and // (evaluated left to right); + and - come last.
  2. Types: true division / always returns a float in Python 3 (6/3 is 2.0, not 2), while // between two ints returns an int. Any arithmetic mixing a float with an int produces a float.

Step-by-step trace

StepSub-expression evaluatedResultExpression so far
14**3 (highest precedence)646/3 + 64//8 - 4
26/3 (leftmost of /, //)2.0 (float!)2.0 + 64//8 - 4
364//88 (int)2.0 + 8 - 4
42.0 + 810.010.0 - 4
510.0 - 46.06.0

Run it:

print(6/3 + 4**3//8-4)

Output:

6.0

Why the other options are wrong …

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.