MCQ Practice Single Best Answer Topic: Python Set MCQ

Q The symmetric_difference() method returns a set that contains all items from both sets, but not the items that are present in both sets.

Question ID
#3810
Subchapter
Python Set MCQ
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A False
  • B True
Correct Answer: B

Explanation

True

Question was not answered

Example:

A = {30, 20, 10}
B = {50, 30, 40}
print(A.symmetric_difference(B))

Output:

{40, 10, 50, 20}

Share This Question

Share this MCQ with your friends or study group.