Definition
The remove() method removes the specified element from the set. This method will raise an error if the specified item does not exist.
Syntax
set.remove(item)
Parameters
Parameter | Description |
---|---|
item | Required. The item to search for, and remove |
Examples:
persons = {"Arnel", "Marie", "Mark", "Jeff", "Ivan", "Mike"}
persons.remove("Arnel")
print(persons)