why does list's .remove() does not return an object?

Abdur-Rahmaan Janhangeer arj.python at gmail.com
Thu May 17 22:07:15 EDT 2018


ah there's no return question then

that precisely returned the discussion to the first answer

Abdur-Rahmaan Janhangeer
https://github.com/Abdur-rahmaanJ

On Thu, 17 May 2018, 23:35 Tobiah, <toby at tobiah.org> wrote:

> On 05/17/2018 09:25 AM, Ned Batchelder wrote:
> > On 5/17/18 11:57 AM, Abdur-Rahmaan Janhangeer wrote:
> >> x = [0,1]
> >> x.remove(0)
> >> new_list = x
>
> Just call the original list 'new_list' to begin with.
>
>    new_list = [0, 1]
>    new_list.remove(0)
>
>
> There you are!
> --
> https://mail.python.org/mailman/listinfo/python-list
>



More information about the Python-list mailing list