Built in Methods in Python.
BUILT IN METHOD:
append()
append() method add a list item in the end of list.
output:
Count()
Count() return the numbers of time x apper in list.
output:
Clear()
It will remove all the item from list.
output:
Copy()
This method is used to return a same copy of the list.
output:
extend(object x)
append all element of the list l2 to the list l1 or vice-versa.
output:
index(object x)
Return the index of the first occurance of the element x from the list.
output:
pop()
Remove the element from the given position. The parameter is optional if it is not specify then it remove the last element from the list
output:
Remove (object x)
Remove the first occurance of element x from the list .
output:
Insert (int x,object c)
Insert() method add a item in list to given index.
output:
Reverse()
it reverse the element of the list.
output:
Sort()
These method is used to sort the element in the list.
output:
Comments
Post a Comment