The clear() method removes all elements from the set.
set.clear() parameters: The clear() method doesn't take any parameters. Return: The clear() method doesn't return any value.
GEEK before clear: set(['s', 'e', 'k', 'g']) GEEK after clear: set()
It is used to clear set.
GEEK before clear: set([0, 1, 4, 6]) GEEK after clear: set()
- PyQt5 – How to clear the content of label | clear and setText method
- Python Dictionary clear()
- How to clear screen in python?
- Different ways to clear a list in Python
- Matplotlib.axes.Axes.clear() in Python
- clear() element method - Selenium Python
- Matplotlib.figure.Figure.clear() in Python
- Clear LRU Cache in Python
- Python - turtle.clear()
- clear() method in PyQt5
- Python | Set 4 (Dictionary, Keywords in Python)
- Operator Functions in Python | Set 2
- Time Functions in Python | Set-2 (Date Manipulations)
- Generate all permutation of a set in Python
- Interesting facts about strings in Python | Set 1
- Interesting facts about strings in Python | Set 2 (Slicing)
- Creating a Proxy Webserver in Python | Set 1
- Function Decorators in Python | Set 1 (Introduction)
- Creating a Proxy Webserver in Python | Set 2
- Object Oriented Programming in Python | Set 1 (Class, Object and Members)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.