Function Details: remove_(set)

Description


Remove an element from a set; it must be a member.


Extended Description


The remove() method removes the specified element from the set. If the element is not present in the set, it raises a KeyError. This method directly modifies the set and does not return any value.


Function Signature



Module: set

Class: set

Parameters



Parameter List


  • element: Any

Return


This method doesn't return a value. It modifies the set in-place.


Return Type


None

Output

Explanation

This example demonstrates the basic usage of remove(). The element 2 is removed from the set.