Use the del keyword to delete the variable. Once we delete the variable, it will not be longer accessible and eligible for the garbage collector.
Example:
var1 = 100
print(var1) # 100
Now, let's delete var1 and try to access it again.
Example:
var1 = 100
del var1
print(var1) # wrong processing
Output:
NameError: name 'var1' is not defined