Skip to content

How to clear a list in Python?

your_list = [1,2,3,4,5,6,7,8,9,10]
your_list.clear() #List becomes [] empty
See also  How to read file again in Python?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.