Articles → Python → del method in python for deleting module from default namespace

del method in python for deleting module

from default namespace






Purpose




Picture showing the del method for deleting the module from default namespace in python

Click to Enlarge












Using del for variables




temp = "This is temp variable"

# Print
print(temp)

#Delete
del(temp)

# Print (This method will give error)
print(temp)




Picture showing the del method to delete the variable in python

Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Tuesday, April 16, 2019
 
Updated On  -  Wednesday, May 15, 2019

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250