python remove clears list code example
Example 1: how to clear a list in python
yourlist = [1,2,3,4,5,6,7,8]
del yourlist[:]
Example 2: deleting a list in python
# deletes whole list
thislist = ["apple", "banana", "cherry"]
del thislist
yourlist = [1,2,3,4,5,6,7,8]
del yourlist[:]
# deletes whole list
thislist = ["apple", "banana", "cherry"]
del thislist