built in method to remove items from list code example
Example 1: delete all elements in list python
mylist = [1, 2, 3, 4]
mylist.clear()
print(mylist)
# []
Example 2: delete a value in list python
list.remove(element)
Example 3: how to remove a element from list in python and print it
pop(n) removes the element at the given index number and can print it
Example 4: delete item from list
listname.remove(element)