Re: mutable sequences

2018-06-14 Thread Sharan Basappa
Thanks, All, for the responses. -- https://mail.python.org/mailman/listinfo/python-list

Re: mutable sequences

2018-06-14 Thread Ben Finney
Larry Martell writes: > 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 th

Re: mutable sequences

2018-06-14 Thread Larry Martell
On Wed, Jun 13, 2018 at 10:56 PM, Sharan Basappa 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 s

RE: mutable sequences

2018-06-14 Thread Schachner, Joseph
No, it says lists are mutable and tuples are immutable. Mutable has the same root as "mutation". Mutable means "can be changed in place". Immutable means "cannot be changed in place". Examples: 1) pass your list to a function, the function modifies the list. When the function returns your

Re: mutable sequences

2018-06-13 Thread Ben Finney
Sharan Basappa writes: > For example, Python lists are mutable. Yes, that's correct. > BTW, is the below explanation correct (it is taken from a book I am > reading) > > Python lists are mutable sequences. They are very similar to tuples, > but they don't have the restrictions due to immutabili

Re: mutable sequences

2018-06-13 Thread Chris Angelico
On Thu, Jun 14, 2018 at 12:56 PM, Sharan Basappa wrote: > The term mutable appears quite often in Python. > Can anyone explain what is meant by mutable and immutable sequences. > > For example, Python lists are mutable. > > BTW, is the below explanation correct (it is taken from a book I am readin

Re: mutable sequences

2018-06-13 Thread Jim Lee
On 06/13/2018 07:56 PM, Sharan Basappa wrote: The term mutable appears quite often in Python. Can anyone explain what is meant by mutable and immutable sequences. Mutable means changeable, and immutible means not mutable, or unchangeable. For example, Python lists are mutable. BTW, is the be