warming up your workspace

Immutability

Applies to: general, python

Immutability means a value cannot be changed after it is created; an update produces a new value instead. Immutable data is easier to reason about and safe to share across threads. Python strings and tuples are immutable; lists are not.

s = "abc"
s.upper()    # returns 'ABC', s is still 'abc'

See also: variable, data-type