Python Dictionary clear() Method
❮ Dictionary Methods
Example
Remove all elements from the car
list:
car = {
"brand": "Ford",
"model":
"Mustang",
"year": 1964
}
car.clear()
print(car)
Try it Yourself »
Definition and Usage
The clear()
method removes all the elements from a
dictionary.
Syntax
Parameter Values
No parameters
❮ Dictionary Methods