Which of the following is a membership operator in Python?
2026
Which of the following is a membership operator in Python?
- A.
==
- B.
in
- C.
not
- D.
+=
Attempted by 309 students.
Show answer & explanation
Correct answer: B
In Python, membership operators test whether a value exists within a sequence. The 'in' operator is the primary membership operator, returning True if an element is found in a list, string, or tuple. For example, 'a' in ['a', 'b'] evaluates to True.