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 t
I agree with others that I don't see a compelling need to add these to Python,
since they are all easy to implement in a few lines.
But what I really want to say is that Python tries hard to be easily readable
and easily understood, by any reader. List.removeall( ) that does not remove
all ele
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 plac
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]
>>> def
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