Python List clear() Method
Last Updated : 5 Jan 2026
The Python list clear() method removes all the elements from the list. It clear the list completely and returns nothing. It does not require any parameter and returns no exception if the list is already empty.
Syntax of the clear() Method in Python List
The following is the syntax of the list clear() method:
Parameter
- No parameter
Return
- It returns None.
Examples of List clear()
Let's see some examples of list clear() method to understand it's functionality.
Example 1: Simple Use of the List clear() Method
Let's see a simple example in which clear() method is used to clear a list. The clear() method clears all the elements from the list.
Output:
Given List: ['1', '2', '3'] Updated List: []
Explanation:
In the above example, we are given a list. We used the clear() method to remove all the elements from the list. As a result, the list becomes empty.
Example 2: Clearing an Empty List
If the list is already empty, the method returns nothing. See the example below.
Output:
Given List: [] Updated List: []
Explanation:
In this example, we are given an empty list. We used the clear() method to clear the list. Since, the list is already empty, there is no impact on the list after using clear(). Hence, it returns nothing.
Conclusion
Python contains different built-in methods and functions that help developers to easily create flawless software. The Python list clear() method is extremely useful in situations where we want to quickly empty the list. This tutorial has covered all the details and examples regarding this method, but don't limit yourself to these examples; instead, try more and more examples to be proficient.