how to delete all elements in a list in python code example
Example 1: how to clear all elements in a list python
# this clear whole elements from list
thislist = ["apple", "banana", "cherry"]
thislist.clear()
Example 2: python list remove all elements
l = [1,2,3,4]
l.clear()