mutable sequences

Larry Martell larry.martell at gmail.com
Thu Jun 14 09:59:26 EDT 2018


On Wed, Jun 13, 2018 at 10:56 PM, Sharan Basappa
<sharan.basappa at gmail.com> wrote:
> The term mutable appears quite often in Python.
> Can anyone explain what is meant by mutable and immutable sequences.

A string and a list go into a bar. The string asks for a cup of
coffee. The bartender says "We don't have coffee." The string asks for
a cup of coffee. The bartender says "I told you we don't have coffee."
The string asks for a cup of coffee. The bartender says to the list
"What is wrong with him? Is he deaf?" The list replies, "No, he's
immutable."



More information about the Python-list mailing list