![]() |
VOOZH | about |
Yes, sets are mutable in Python. This means that you can modify the contents of a set after it has been created. You can add or remove elements from a set but like dictionaries, the elements within a set must be immutable types.
You can add elements to a set using add() method:
{1, 2, 3, 4}
When we say that sets are mutable, we mean that: