Python Set pop() Syntax
Syntax: set_obj.pop()
Parameter: set.pop() doesn’t take any parameter.
Return: Returns the popped element from the set
Python Set pop() Method
Python set pop() removes any random element from the set and returns the removed element. In this article, we will see about the Python set pop() method.
Example
Input: {9, 1, 0} Output: {9, 1} Explanation: By using set pop() method, a random element 0 is removed from the set and remaining set is returned.
Contact Us