In this lesson you’ll have a look at different examples of mutable and immutable objects in Python. The objects being covered include lists, tuples and dictionaries.
Examples for Mutable and Immutable Objects
00:13 Or it could also be a set. Those are all mutable. Then if you have a custom class, that’s also mutable by default. We can just go in and change attributes on the class. Now, what are some examples for objects that are immutable, that can’t be freely modified in Python? One typical example would be a string.
Become a Member to join the conversation.