Python Set discard() method

Python Set discard() method

The set.discard() method in Python removes a specified element from the set (if present).

Syntax

Parameter

value- This parameter represents the element to be removed from the set.

Return

None

Example 1

Output

Example 2

Output