How to Remove All Items From a List in Python
Removing all items from the list can be done by using various different methods in Python. Using clear()clear() method is the simplest and most efficient way to remove all items from a list.Pythona = [1, 2, 3, 4, 5] # Remove all items using clear() a.clear() # Print the empty list print(a) Output[]