This article is part 3 of 4 in the series Python Classes Tutorial

Using the del statement is relatively straightforward: it's used to delete something. Often it's used to remove an item from a list by referring to the item's index rather than its value. For example, if you have the following list:

list = [4, 8, 2, 3, 9, 7]

And you want to remove the number 3, which has an index of 4, because it is the 4th item in the list, you could do so using the del statement, like this:

del list[4]

So your list will now look like this:

list = [4, 8, 2, 9, 7]