python dict remove all code example
Example 1: remove all elements from dictionary python
thisdict = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
thisdict.clear()
Example 2: how to empty a dictionary in python
dict.clear()
thisdict = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
thisdict.clear()
dict.clear()