How to remove all the elements from the list in Python

You can remove all the elements from the list in Python by following the given step. If you want to learn Python then I will highly recommend you to read This Book.

How to remove all the elements from the list in Python
How to remove all the elements from the list in Python

Step 1

Clear Method is used to remove all the elements from the list in Python.

a = [1,2,3,4,5,6,7,8,9,10]
print(a)
a.clear()
print(a)

People are also reading:

What is Computer Vision? Examples, Applications, Techniques

Top 10 Python Books | Best Python Books

Machine Learning Books

Top 10 Deep Learning Books

Top 10 Computer Vision Books

Best Data Science Books

Artificial Intelligence Books

Top 30 Applications of Artificial Intelligence

Leave a Comment

Your email address will not be published.