YouTip LogoYouTip

Ref Set Clear

# Python3.x Python Set clear() Method [![Image 1: Python3 Lists](#) 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() [![Image 2: Python3 Lists](#) Python Sets](#)
← Ref Set DifferenceMysql Func Ifnull β†’