list = [10,20,30,40,50,60]
[10, 20, 40, 50, 60]
What is del() keyword in python
In Python, the del keyword is mostly used to remove objects. Because everything in Python is an object, the del keyword may be used to delete a list, slice a list, delete dictionaries, remove key-value pairs from dictionaries, delete variables, and so on.
To delete an element by value, use del to delete it by index, pop() to delete it by index if you require the returned value, and remove() to delete it by value. The latter involves scanning the list, and if no such value is found, it generates a ValueError.