delete an element in list code example
Example 1: delete all elements in list python
mylist = [1, 2, 3, 4]
mylist.clear()
print(mylist)
# []
Example 2: deleting a list in python
# deletes whole list
thislist = ["apple", "banana", "cherry"]
del thislist