home ~ socials ~ projects ~ rss

Remove Items From A Set In Python

September 2021

You can remove items from a set with either .remove() or `.discard()`

.remove() will error if the target item doesn't exist

.discard() will not

end of line
Share link:
https://www.alanwsmith.com/en/20/eo/qq/1o/?remove-items-from-a-set-in-python