Course
Simulator
More
Premium
Log in
Python Function Reference
Functions
symmetric_difference
symmetric_difference
Return a new set with elements in either the set or other but not both.
Python 3.13
set
.
symmetric_difference
(
other
)
other
Another set.
Examples
Python 3.13
>>
>
{
1
,
2
,
3
}
.
symmetric_difference
(
{
2
,
3
,
4
}
)
{
1
,
4
}