The del statement unbinds variables and attributes, and removes parts (positions, slices, or slots) from data structures (mappings or sequences). : Del : Statement PYTHON TUTORIALS


PYTHON TUTORIALS » Statement » Del »

 

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



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Statement
» Del