To remove an item from a list using index number, you can use
Del function removes the item with the given index from the list. Here is an example usage:
mylist = ["apple", "banana", "kivi"] del(mylist) print(mylist)
This code snippet will output following:
While using this function, you have to note that list item indexes start from zero. So, if you want to remove the first item from the list, you need to give index as “0”.
Another important point is that, if you remove an item from the list, list indexes are updated. So if you use the same function once more:
The output will be: