Python Set symmetric_difference() method

Facebooktwitterredditpinterestlinkedinmailby feather

Python Set symmetric_difference() method

The set.symmetric_difference() method returns a new set, which is the symmetric difference of two sets. The returned set contains only the unique items and, hence, deleting the common elements of both the sets.

Syntax

Parameter

set- This parameter represents the first set that is used for checking the matches.

set1- This parameter represents the second set that is used for checking the matches.

Return

This method returns a set that contains only the unique items from both the sets thus, deleting the common elements or intersection from both the sets.

Example 1

Output

Example 2

Output

Example 3

Output

Facebooktwitterredditpinterestlinkedinmailby feather