The del statement unbinds variables and attributes, and removes parts (positions, slices, or slots) from data structures (mappings or sequences). : del « Statement « Python Tutorial
3. 7. 1. The del statement unbinds variables and attributes, and removes parts (positions, slices, or slots) from data structures (mappings or sequences).
# Values are only deleted through garbage collection.
seq = [1,2,3,4]
del seq[2] # Deletes a sequence element
del seq[2:] # Deletes a sequence slice
3. 7. del
3. 7. 1.
The del statement unbinds variables and attributes, and removes parts (positions, slices, or slots) from data structures (mappings or sequences).