The clear method
The clear
method removes all elements from the set. After using this method, the set will be empty. We do not pass anything in the method parameter.
Syntax
set.clear()
Example
Let's remove all elements from our set:
st = {'a', 'b', 'c'}
st.clear()
print(st)
Result of code execution:
set()