Course
Simulator
More
Premium
Log in
Python Function Reference
Functions
discard
discard
Remove element elem from the set if it is present.
Python 3.13
set
.
discard
(
elem
)
Examples
Python 3.13
>>
>
s
=
{
1
,
2
,
3
}
>>
>
s
.
discard
(
4
)
{
1
,
2
,
3
}