On 03/09/18 18:49, C W wrote:
> Hello all,
>
> I am learning the basics of Python. How do I know when a method modifies
> the original object, when it does not. I have to exmaples:
> Example 1:
>> L = [3, 6, 1,4]
>> L.reverse()
>> L
> [4, 1, 6, 3]
> This changes the original list.
Lists are mutabl
Mark Lawrence Sent: Monday, September 3, 2018
2:21:36 PM To: python-list@python.org
Subject: Re: Why list.reverse() modifies the list, but name.replace() does not
modify the string?
On 03/09/18 18:49, C W wrote:
> Hello all,
>
> I am learning the basics of Python. How do I know when a m
On Tue, Sep 4, 2018 at 3:49 AM, C W wrote:
> Hello all,
>
> I am learning the basics of Python. How do I know when a method modifies
> the original object, when it does not. I have to exmaples:
> Example 1:
>> L = [3, 6, 1,4]
>> L.reverse()
>> L
> [4, 1, 6, 3]
> This changes the original list.
>
>
On Mon, Sep 3, 2018 at 1:50 PM C W wrote:
>
> Hello all,
>
> I am learning the basics of Python. How do I know when a method modifies
> the original object, when it does not. I have to exmaples:
> Example 1:
> > L = [3, 6, 1,4]
> > L.reverse()
> > L
> [4, 1, 6, 3]
> This changes the original list.
f
of Mark Lawrence
Sent: Monday, September 3, 2018 2:21:36 PM
To: python-list@python.org
Subject: Re: Why list.reverse() modifies the list, but name.replace() does not
modify the string?
On 03/09/18 18:49, C W wrote:
> Hello all,
>
> I am learning the basics of Python. How do I know
On 03/09/18 18:49, C W wrote:
Hello all,
I am learning the basics of Python. How do I know when a method modifies
the original object, when it does not. I have to exmaples:
Example 1:
L = [3, 6, 1,4]
L.reverse()
L
[4, 1, 6, 3]
This changes the original list.
Lists are mutable, i.e. can be ch
On Tue, Sep 4, 2018 at 3:49 AM, C W wrote:
> Hello all,
>
> I am learning the basics of Python. How do I know when a method modifies
> the original object, when it does not. I have to exmaples:
> Example 1:
>> L = [3, 6, 1,4]
>> L.reverse()
>> L
> [4, 1, 6, 3]
> This changes the original list.
>
>
On Mon, Sep 3, 2018 at 1:50 PM C W wrote:
>
> Hello all,
>
> I am learning the basics of Python. How do I know when a method modifies
> the original object, when it does not. I have to exmaples:
> Example 1:
> > L = [3, 6, 1,4]
> > L.reverse()
> > L
> [4, 1, 6, 3]
> This changes the original list.