Python List clear()
Clear() in Python List
The clear() method removes all the elements present in a list. Basically it is used to clear the list.
clear() method does not take any parameters.
Return Type :
The clear() method does not return any value.
#clear() in python list
myList = [ 1, 2, 9, 10, 4, 4, 2 ]
#all the values deleted from list
Output : [1, 2, 9, 10, 4, 4, 2]