Answer
The printout of the given code will be -
{1, 3, 4, 5, 6, 7}
{1, 3, 4, 5, 6, 7}
{1, 6}
{1, 6}
{4, 5}
{4, 5}
{3, 4, 5, 7}
{3, 4, 5, 7}
Work Step by Step
union is the method of set class which returns the union of two sets
intersection is the method of set class which returns the intersection of two sets
difference is the method of set class which returns the difference of two sets
symmetric_difference is the method of set class which returns the symmetric_difference of two sets
| operator provides the union of given sets
& operator provides the intersection of given sets
^ operator provides the set exclusive or of given sets
- operator provides the set difference of the given sets