Many of the features of python were added not out of need but rather for
convenience.
If need were the only criteria we could immediately get rid of
comprehensions, since they can be written as a series of for loops, the
same can be said for many other newer features.
Python is all about making
AM
To: python-list@python.org; python-id...@python.org
Subject: Python Enhancement Proposal for List methods
Hey everyone,
I am really new to Python contribution community want to propose below methods
for List object. Forgive me if this is not the format to send an email.
1. *list.replace
On Mon, Oct 22, 2018 at 11:20 PM Lutz Horn wrote:
>
> On Sun, Oct 21, 2018 at 06:06:40PM +0530, Siva Sukumar Reddy wrote:
> > 1. *list.replace( item_to_be_replaced, new_item )*: which replaces all the
> > occurrences of an element in the list instead of writing a new list
> > comprehension in
On Sun, Oct 21, 2018 at 06:06:40PM +0530, Siva Sukumar Reddy wrote:
> 1. *list.replace( item_to_be_replaced, new_item )*: which replaces all the
> occurrences of an element in the list instead of writing a new list
> comprehension in place.
Try this:
>>> l = [1, 3, 4, 5, 6, 5, 4, 3, 2, 1]
>>>
Siva Sukumar Reddy wrote:
> I am really new to Python contribution community want to propose below
> methods for List object. Forgive me if this is not the format to send an
> email.
>
> 1. *list.replace( item_to_be_replaced, new_item )*: which replaces all the
> occurrences of an element in the
Hey everyone,
I am really new to Python contribution community want to propose below
methods for List object. Forgive me if this is not the format to send an
email.
1. *list.replace( item_to_be_replaced, new_item )*: which replaces all the
occurrences of an element in the list instead of writing