#clear all value to set in python set_A= {"Apple", "Orange", "coconut"} set_A.add("pineapple") set_A.remove("Apple") set_A.clear() for x in set_A: print(x)
mySet = {1, 2, 3} mySet.clear() print(mySet) # Output: # set()