Course
Simulator
More
Premium
Log in
Python Function Reference
Functions
difference
difference
Return a new set with elements in the set that are not in the others.
Python 3.13
set
.
difference
(
*
others
)
*others
Other sets.
Examples
Python 3.13
>>
>
{
1
,
2
,
3
}
.
difference
(
{
2
,
3
,
4
}
)
{
1
}