Module 07
Mutable and Immutable Objects
Understand object mutability and copying behavior in Python.
01
Mutable vs Immutable Objects — Overview
Understand one of Python's most important concepts: which objects can change in place, which create new objects, and how id() reveals the difference.
02
Immutable Types in Python
Master Python's immutable built-in types with visual memory diagrams, id() proofs, and item-assignment rules.
03
Mutable Types in Python
Learn how list, set, dict, and bytearray modify data in place, keep the same id(), and affect every variable pointing to the same object.
04
Item Assignment and id() in Python
Understand why lst[0] = 99 works, why s[0] = P fails, and how id() proves whether Python modified an object or created a new one.
05
Aliasing, Copying, and Mutation Traps
Master one of Python's most common interview and real-world bugs: understanding when two variables share the same mutable object and when they don't.
06
Mutable & Immutable — Practice Programs
Practice id(), item assignment, aliasing, copying, and object identity through real Python programs.