Problem Solving 2
Problem Solving 2
MCQs [set-1]
o m
.
2. What will be the value of the following Pythoncexpression? 4 + 3 % 5
A. 4
te
B. 7 a
C. 2
q M
D. 0 c
Answer: B
M
Explanation:- the order of precedence is: %,+. Hence the expression above, on simplification results
in 4 + 3 = 7. Hence the result is 7.
3. Which of the following operators has its associativity from right to left?
A. +
B. //
C. %
D. **
Answer: D
Explanation:- all of the operators shown above have associativity from left to right, except
exponentiation operator (**) which has its associativity from right to left.