Glossary
Immutable
Immutable and mutable data types in Python
In Python, immutable means you are not able to edit something. Mutable means you are. This is due to the way the data types are created in Python. Donβt fear, this isnβt a blocker, there is always a solution if you run into a problem.
The common types of immutable data are int, float, bool, str, tuple.
Python Immutable
If you run into an immutable object, and you need to edit it, then youβll need to change the data type. For example: change your tuple to a list or dict.
Letβs look at a quick code sample.