Python MCQs Operators

Q1. Which operator is used for addition in Python?

A) *
B) +
C) –
D) /
✅ Correct Answer: (B) +
📘 Explanation: The + operator is used to add two values.

Q2. Which operator is used to find the remainder of a division?

A) /
B) //
C) %
D) **
✅ Correct Answer: (C) %
📘 Explanation: The modulus % operator returns the remainder.

Q3. What does the ** operator do?

A) Multiplication
B) Division
C) Exponentiation
D) Modulus
✅ Correct Answer: (C) Exponentiation
📘 Explanation: ** is used for raising a number to a power.

Q4. Which operator performs floor division?

A) /
B) //
C) %
D) **
✅ Correct Answer: (B) //
📘 Explanation: // returns the quotient without the decimal part.

Q5. Which of the following is a comparison operator?

A) =
B) ==
C) +=
D) **
✅ Correct Answer: (B) ==
📘 Explanation: == compares two values for equality.

Q6. What is the output of 10 > 5?

A) True
B) False
C) 15
D) Error
✅ Correct Answer: (A) True
📘 Explanation: 10 is greater than 5, so the result is True.

Q7. Which operator is used for logical AND?

A) &
B) and
C) &&
D) |
✅ Correct Answer: (B) and
📘 Explanation: Python uses the keyword and for logical AND.

Q8. Which operator is used for logical OR?

A) or
B) ||
C) |
D) &
✅ Correct Answer: (A) or
📘 Explanation: Python uses or for logical OR operations.

Q9. Which operator is used to assign a value?

A) ==
B) =
C) <=
D) !=
✅ Correct Answer: (B) =
📘 Explanation: The assignment operator = assigns values.

Q10. Which operator checks whether two values are NOT equal?

A) ==
B) !=
C) =
D) <=
✅ Correct Answer: (B) !=
📘 Explanation: != returns True if values are different.

Q11. What is the output of 5 == 5?

A) True
B) False
C) Error
D) None
✅ Correct Answer: (A) True
📘 Explanation: Both values are equal, so result is True.

Q12. Which operator is used to check membership in a sequence?

A) in
B) is
C) not
D) end
✅ Correct Answer: (A) in
📘 Explanation: in checks if a value exists in a sequence.

Q13. Which operator checks object identity?

A) ==
B) is
C) =
D) !=
✅ Correct Answer: (B) is
📘 Explanation: is checks whether both variables point to the same object.

Q14. What is the output of 10 // 3?

A) 3.33
B) 3
C) 4
D) Error
✅ Correct Answer: (B) 3
📘 Explanation: Floor division removes decimal values.

Q15. Which operator is used for bitwise AND?

A) and
B) &&
C) &
D) |
✅ Correct Answer: (C) &
📘 Explanation: & performs bitwise AND.

Q16. Which operator is used to increment a value by 1?

A) ++
B) +=1
C) +1
D) increment
✅ Correct Answer: (B) +=1
📘 Explanation: Python does not support ++. Use += 1.

Q17. What is the output of not True?

A) True
B) False
C) Error
D) None
✅ Correct Answer: (B) False
📘 Explanation: not reverses the Boolean value.

Q18. Which operator has the highest precedence?

A) +
B) *
C) **
D) %
✅ Correct Answer: (C) **
📘 Explanation: Exponentiation (**) has the highest precedence.

Q19. Which operator is used to combine strings?

A) *
B) –
C) +
D) /
✅ Correct Answer: (C) +
📘 Explanation: + concatenates strings.

Q20. Which operator is used for bitwise OR?

A) ||
B) or
C) |
D) &
✅ Correct Answer: (C) |
📘 Explanation: | performs bitwise OR operations.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top