2 MCQ Class 11th Operators
2 MCQ Class 11th Operators
: 9810301034
PRECEDENCE AND ASSOCIATIVITY – 1
1. The value of the expressions 4/(3*(2-1)) and 4/3*(2-1) is the same. State whether True or false. a) True b) False
2. The value of the expression: 4+3%5
a) 4 b) 7 c) 2 d) 0
3. Evaluate the expression given below if A= 16 and B = 15. A % B // A
a) 0.0 b) 0 c) 1.0 d) 1
4. Which of the following operators has its associativity from right to left?
a) + b) // c) % d) **
5. What is the value of x if: x = int(43.55+2/2)
a) 43 b) 44 c) 22 d) 23
6. What is the value of the following expression? 2+4.00, 2**4.0
a) (6.0, 16.0) b) (6.00, 16.00) c) (6, 16) d) (6.00, 16.0)
7. Which of the following is the truncation division operator?
a) / b) % c) // d) |
8. What are the values of the following expressions: 2**(3**2), (2**3)**2, 2**3**2
a) 64, 512, 64 b) 64, 64, 64 c) 512, 512, 512 d) 512, 64, 512
9. What is the value of the following expression: 8/4/2, 8/(4/2)
a) (1.0, 4.0) b) (1.0, 1.0) c) (4.0. 1.0) d) (4.0, 4.0)
10. What is the value of the following expression: float(22//3+3/3)
a) 8 b) 8.0 c) 8.3 d) 8.33
PRECEDENCE AND ASSOCIATIVITY – 2
1. What is the output of the following expression: print (4.00/(2.0+2.0))
a) Error b) 1.0 c) 1.00 d) 1
2. Consider the expression given below. The value of X is: X = 2+9*((3*12)-8)/10
a) 30.0 b) 30.8 c) 28.4 d) 27.2
3. Which of the following expressions involves coercion when evaluated in Python?
a) 4.7 – 1.5 b) 7.9 * 6.3 c) 1.7 % 2 d) 3.4 + 4.6
4. What is the value of the following expression: 24//6%3, 24//4//2
a) (1,3) b) (0,3) c) (1,0) d) (3,1)
5. Which among the following list of operators has the highest precedence? +, -, **, %, /, <<, >>, |
a) <<, >> b) ** c) | d) %
6. What is the value of the expression: float(4+int(2.39)%2)
a) 5.0 b) 5 c) 4.0 d) 4
7. Which of the following expressions is an example of type conversion?
a) 4.0 + float(3) b) 5.3 + 6.3 c) 5.0 + 3 d) 3 + 7
8. Which of the following expressions results in an error?
a) float(‘10’) b) int(‘10’) c) float(’10.8’) d) int(’10.8’)
9. What is the value of the expression: 4+2**5//10
a) 3 b) 7 c) 77 d) 0
10. The expression 2**2**3 is evaluates as: (2**2)**3. State whether this statement is True or false. a) True b)
False
BOOLEAN
1. The output of the snippet of code shown below? bool(‘False’), bool()
a) True True b) False True c) False False d) True False