Web Analytics

Python dict.clear() Method

Dictionary Method โ€ข Clear All

The clear() method removes all the elements from the dictionary.

Syntax

dictionary.clear()

Parameters

No parameters.

Return Value

None. The dictionary is modified in place.

Example

Using the clear() method:

Output
Click Run to execute your code

Related Functions