Ref Set Clear
# Python3.x Python Set clear() Method
[ Python Sets](#)
* * *
## Description
The `clear()` method is used to remove all elements from a set.
## Syntax
The syntax for the `clear()` method is:
set.clear()
## Parameters
* None.
## Return Value
None.
## Example
Remove all elements from the `fruits` set:
## Example 1
fruits = {"apple", "banana", "cherry"} fruits.clear()print(fruits)
The output result is:
set()
[ Python Sets](#)
YouTip