EN
Python - clear set
0
points
In this article, we would like to show you how to clear the set in Python.
Practical example
In this example, we use clear()
method to empty the set.
my_set = {'A', 'B', 'C'}
my_set.clear()
print(my_set) # set()
Output:
set()