Skip to content

Instantly share code, notes, and snippets.

@ardenn
Created October 1, 2018 18:01
Show Gist options
  • Save ardenn/ce9c271b81b9a9c7755c473b097aa6be to your computer and use it in GitHub Desktop.
Save ardenn/ce9c271b81b9a9c7755c473b097aa6be to your computer and use it in GitHub Desktop.
Python Dictionaries Tutorial - Deletion
del job2["salary"]
del job2["available"]
print(job2) #return a dictionary without 'salary' and 'available' entries
job1.clear()
print(job1) #return an empty dictionary
del job1
print(job1) # return NameError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment