Python Tips - 04
Mutable vs Immutable Objects in PYTHON
Every variable in python is an object and there are two types of objects in python.
They are
- Immutable Objects
- Mutable Objects
Immutable Objects
- Objects that can not be modified after creating
- int, float, decimal, bool, string and tuples are immutable objects in python
Mutable Objects
- Objects that can be modified whenever needed
- Lists, Dictionaries and Sets are mutable objects in python
Comments
Post a Comment