AI engineering glossary · Python core

What is mutable?

Mutable: Describes an object that can be changed in place after it is created, without making a new object. Lists, dictionaries and sets are mutable in Python. Mutability matters because several names can share one object, so a change through one name is visible through the others.

Level: beginnerTopic: Python core

Mutable: an example

a = [1, 2]; b = a; b.append(3) makes a equal to [1, 2, 3] too, because both names point to the same list.

Related terms

More Python core terms

Where you learn it

Mutable is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.