append() :Appending elements to a list
Adds a single item to the end of the list. Does not return a new list, just modifies the original.
extend() :Appending multiple elements to a list
append() adds one element to a list, extend() can add multiple elements from a list supplied to it as an argument. Returns no value.
List.insert(<pos>,<item>)
Append() and extend() insert the element(s) at the end of the list
If you want to insert an element somewhere in between or any position of your choice, insert() method is used.
<pos> is the index of the element before which the second argument is to be added
Returns no value
Updating elements to a list
To update or change and element of the list in place, you just have to assign new values to the element’s index in list as per Syntax :
L[index] = <new value>
Deleting Elements from a List
The del statement can be used to remove an individual item, or to remove all the items identified by a slice . It is to be lost as per Syntax given below:
del List[<index>]
del List[<start>:<stop>]
List.sort()
Sorts the items of the list in place.
The default order is increasing.
To reverse in decreasing order, reverse=True is used.
Returns nothing.
If the elements within a list consist of complex numbers, sort() will not work.