What is the output of print({1, 2} ^ {2, 3}) in Python?
print({1, 2} ^ {2, 3})
Correct answer
A. {1, 3}
5 views
A. {1, 3}
5 views
The ^ operator returns the symmetric difference.
Asked in: Python Interview Sets
https://docs.python.org/3/tutorial/datastructures.html#setsNot sure why the answer is A? Ask here and get an explanation.