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









Using Del For Variables




temp = "This is temp variable"

# Print
print(temp)

#Delete
del(temp)

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



Output


Picture showing the del method to delete the variable in python



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