Menu

Post image 1
Post image 2
Post image 3
1 / 3
0

Understanding Mutable and Immutable Objects in Python

DEV Community·Samiksha Srivastav·26 days ago
#5vfOOdZz
Reading 0:00
15s threshold

Now let's discuss mutable and immutable objects in Python. First, Mutable means something that can change Immutable means something that cannot change So, any data or object whose value can be changed after creation is called mutable , and those which cannot be changed are called immutable . It's All About Memory What does "change" actually mean here? This concept is all about how values are stored in memory. Let’s Take an Immutable Data Type (Integer) Let’s understand this with an example in the Python shell: But Wait… We know that integers are immutable, so how are we able to “change” the value of int_2? What’s Actually Happening?…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More