To see the major methods of list in python3.
It add the element in to the list.
Eg:list.append(element).
InsertIt used to add the new element in a corresponding position.
Eg.list.insert(element index position).
PopIt used to delete corresponding index of the object to be removed from the list.
Eg.list.pop(1).
RemoveThis method does not return any value but removes the given object from the list
Eg.list.remove(element).
ReverseIts reverse the given element in a list.
Eg.list.reverse().
list1=[‘sathish’,’sangeetha’,’venkat’,
‘sheela’,’sudhakar’,23,24,25,21,21]
#append the list
print(“**************Append method demo”)
print(“Actual list is\n”,list1)
print(“After append the list”)
list1.append(‘Loganath’)
print(list1)
#insert the list
print(“**************Insert method demo\n”)
print(“After insert the list”)
list1.insert(2,’mano’)
print(list1)
#pop the list
print(“**************Pop method demo\n”)
list1.pop(1)
print(“After pop the list”)
print(list1)
#remove from the list
print(“**************Remove method demo\n”)
list1.remove(‘venkat’)
print(“After remove the list”)
print(list1)
#make reverse of a list
print(“**************Reverse method demo\n”)
list1.reverse()
print(“After reverse the list”)
print(list1)