In programming, mutability refers to the changeability of variables. Those that are mutable can have their values changed without changing their identities. Immutable variables can’t have their values changed.

In other words, if x is an immutable type (like a unique pointer in Rust), then x = y isn’t permitted. Reassigning the value of x also isn’t permitted.

When you pass variables into functions and manipulate them within the function, we don’t observe changes in the main program, because we manipulate a copy of the variables. When we pass arrays, manipulations do change them.

In C, it is because we pass the memory address of the array directly. In Python, it is because lists are mutable, i.e., they can be changed.