Description: List methods are built-in functions that allow you to manipulate and perform operations on lists.Lists are mutable sequences, and these methods provide a variety of ways to modify, access, and interact with list elements.
Step-by-Step Process
Append: It adds a single element to the end of the list.Example: list.append(item)
Extend: It adds all elements of an iterable(like list,tuple) to the end of the list.Example: list.extend(iterable)
Insert: It inserts an element at a specified index.Example: list.insert(index, item)
Remove: It removes the first occurrence of a specified element.Example: list.remove(item)
Pop: It removes and returns the element at the specified index.If no index is provided, it removes and returns the last item.Example: list.pop(index)
Reverse: It reverses the order of the elements in the list.Example: list.reverse()
Clear: It removes all elements from the list.Example: list.clear()