Python Set clear() Method
Removes all the items from the set, returning an empty set.
Syntax
Python
Copy Code
set.clear()
Example
Python
Copy Code
components = {'memory', 'processor', 'SSD'} components.clear() print(components)
Output
set()