In this example we will show how to delete the dictionary completely using the del keyword in Python.
Source Code
mydict = {
'name': 'Steven',
'age': 24,
'ID': 123456
}
del mydict
print(mydict)
Output:
Traceback (most recent call last):
File "demo.py", line 8, in
print(mydict)
NameError: name 'mydict' is not defined