In this example we will show how to delete the list completely using the del keyword in Python.
Source Code
my_list = ['a', 'b', 'c', 'd', 'e']
del my_list
print(my_list) # this will thrown an error because you have succsesfully deleted "my_list"
Output:
Traceback (most recent call last):
File "demo.py", line 3, in
print(my_list) # this will thrown an error because you have succsesfully deleted "my_list"
NameError: name 'my_list' is not defined