Python Set clear() Method
The set.clear()
method removes all the elements from the set.
Syntax:
set.clear()
Parameters:
No parameters.
Return Value:
None.
The following example demonstrates the set.clear()
method.
langs = {'Python','C++','C','Go'}
langs.clear()
print("Set after the clear() method is called: ", langs)
Set after the clear() method is called: set()