Objek immutable tidak boleh diubah selepas penciptaan; objek mutable boleh diubah. Perbezaan ini adalah pusat kepada Python dan mempengaruhi aliasing, dict keys, function arguments, dan kelas bug yang halus.
Dua kategori
Immutable: int, float, bool, str, tuple, frozenset, bytes, None
Mutable: list, dict, set, bytearray, and most custom objects
Immutable: "mengubah" mencipta objek baru
x =
x.upper()
x +=
n =
n +=
