Of the basic types of python, which of those are mutable? From reviewing the docs it looks like:
list
set
(though notfrozenset
)dict
Are the only mutable types, and everything else is immutable, but I wasn't able to find a definitive list on this. Is the above correct, or am I missing any python types that are mutable?
-
Why did this question get negative voting?jaromrax– jaromrax2021年04月30日 10:38:05 +00:00Commented Apr 30, 2021 at 10:38
2 Answers 2
Take a look to this page in documentation. Here you can find all information about mutability of most common types in Python.
P. S. It is rather comment than answer, but my reputation is too small to comment.
Comments
Some of the mutable data types in Python are list, dictionary, set and user-defined classes.
On the other hand, some of the immutable data types are int, float, decimal, bool, string, tuple, and range.