clear() method in Python Lists can be used to delete all the elements from the Python List.
The clear() method in Python Lists returns ‘None‘ as a value, however, it deletes all the elements of a Python List making the list empty.
Syntax
list.clear()
l = [3, 1, 5, 2, 6]
print(l.clear()) # returns None
print(l) # returns an Empty List
O/P
None
[]
That’s all here.
