delete all the elements in a list 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: how to delete lists after using them in python
lst = ['i1', 'i2', 'i3']
lst.clear() #clears the contents of list
#lst[:] can also be used
#fastest is lst *= 0