del keyword in Python | Example code

Python del keyword is used to delete objects. It could delete everything from an object like variables, lists, dictionaries, slice a list, etc. Examples del keyword in Python Simple example code to delete variables, lists, dictionaries, and class objects. Deleting variables Delete both the variables Output: Deleting list Output: NameError: name ‘list1’ is not defined Read More…