 # 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.

To study click 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

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

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

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

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

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

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