Quiz on Python Set Operators



1. What does the union operator '|' do in Python sets?
2. Which operator is used to find the intersection of two sets in Python?
3. What will be the result of the operation A - B where A = {1, 2, 3} and B = {2, 3}?
4. What does the symmetric difference operator '^' do?
5. Which of the following operators can be used to check if one set is a subset of another?

Advertisements