clear() method in Python List

It is a method in python that clears all the content of the list. It empties the existing list. It doesn’t return a value. This method won’t work for Python 3.2 and below. You have to use del operator instead. This method doesn’t take any parameters in it. Syntax: list.clear() Example 1: s = [“Name”, […]

clear() method in Python List Read More »