Anjeev Singh Academy

15+ Important Expression evaluation question answer in Python

Hello Dear Students

In this post, I am sharing important python expression evaluation question answers with valid reasons. These questions help you to understand the precedence of operators in python.

All the best.

Operator Precedence in Python

Operator Precedence  :

Execution of the operator depends on the precedence of the operator. 

OrderOperatorDescription
Highest()Parentheses
**Exponentiation (right to left)
|~Bitwise nor
|+, –Unary plus and Minus
|*, /, //, %Multiplication, Division, floor division, remainder
|+, –Addition, Subtraction
|&Bitwise and
|^Bitwise XOR
||Bitwise OR
|<, <=, >, >=, <>, !=, ==, is, is notRelational Operators, Identity Operators
|notBoolean NOT
andBoolean AND
LowestorBoolean OR
Operator Precedence

To study click arrow Python Operator and Precedence


Evaluating Expression in Python Important Question Answer

Que 1: Consider the following expression:

51 + 4 – 3 ** 3 // 19 – 3

Which of the following will be the correct output if the expression is evaluated?

a. 50
b. 51
c. 52
d. 53

Answer: (b) 51

Reason: Operator execution sequence as per precedence are **, //, + , -, –

=> 51 + 4 – 3 ** 3 // 19 – 3
=> 51 + 4 – 27 // 19 – 3
=> 51 + 4 – 1 – 3
=> 55 – 1 – 3
=> 54 – 3
=> 51


Que 2. What will the following expression be evaluated in Python?

print(6 * 3 / 4 ** 2 // 5 – 8 )

(a) -10
(b) 8.0
(c) 10.0
(d) -8.0

Answer: (d) -8.0

Reason: Operator execution sequence as per precedence are **, *, /, //, –

=> 6 * 3 / 4 ** 2 // 5 – 8
=> 6 * 3 / 16 // 5 – 8
=> 18 / 16 // 5 – 8
=> 1.125 // 5 – 8
=> 0.0 – 8
=> -8


Que 3. What will the following expression be evaluated in Python? [CBSE 2021]

2 * 3 + 4 ** 2 – 5 // 2

(a) 45
(b) 20
(c) 22
(d) 8

Answer: (b) 20

Reason: Operator execution sequence as per precedence are **, *, //, +, –

=> 2 * 3 + 4 ** 2 – 5 // 2
=> 2 * 3 + 16 – 5 // 2
=> 6 + 16 – 5 // 2
=> 6 + 16 – 2
=> 22 – 2
=> 20


Que 4. What will the following expression be evaluated in Python? [CBSE 2021]

6 < 12 and not (20 > 15) or (10 > 5)

(a) True
(b) False
(c) and
(d) not

Answer: (a) True

Reason: Operator execution sequence as per precedence are not, and , or

=> 6 < 12 and not (20 > 15) or (10 > 5)
=> True and not (True) or (True)
=> True and False or True
=> False or True
=> True


Que 5. What will the following expression be evaluated to in Python? [CBSE SQP 2022-23]

print(15.0 / 4 + (8 + 3.0))

(a) 14.75
(b) 14.0
(c) 15
(d) 15.5

Answer: (a) 14.75

Reason: Operator execution sequence as per precedence are (), /, +

=> 15.0 / 4 + (8 + 3.0)
=> 15.0 / 4 + 11.0
=> 3.75 + 11.0
=> 14.75


Que 6. Evaluate the following expression and identify the correct answer. [CBSE SQP 2021-22]

16 – (4 + 2) * 5 + 2**3 * 4

(a) 54
(b) 46
(c) 18
(d) 32

Answer: (c) 18

Reason: Operator execution sequence as per precedence are (), **, *, -, +

=> 16 – (4 + 2) * 5 + 2**3 * 4
=> 16 – 6 * 5 + 2**3 * 4
=> 16 – 6 * 5 + 8 * 4
=> 16 – 30 + 32
=> -14 + 32
=> 18


Que 7. What will the following expression be evaluated in Python? [CBSE 2021]

10 > 5 and 7 > 12 or not 18 > 3

(a) True
(b) False
(c) or
(d) and

Answer: (b) False

Reason: Operator execution sequence as per precedence are not, and , or

=> 10 > 5 and 7 > 12 or not 18 > 3
=> True and False or not True
=> True and False or False
=> False or False
=> False


Sorry! You cannot copy content of this page. Please contact, in case you want this content.

Scroll to Top