Python Set pop() method

Python Set pop() method

The set.pop() method in Python removes an arbitrary element (random item) from the set and returns the element removed.

Syntax

 Parameter

NA

Return

This method returns an arbitrary (random) element from the set.

Example 1

Output

Example 2

Output