The set type represents a collection of unordered, unique elements. Set objects are mutable in that  they can be modified after creation by adding or removing elements.

The pop() methods is used to  remove and return an arbitrary element from the set. 

Syntax:
myset.pop()

The pop() method does not take any argument, it returns the removed element. A KeyError exception is raised if the set is empty.

ExampleEdit & Run
myset = {1, 3, 5, 7, 9, 11}

#remove an arbitrary element
print(myset.pop())
print(myset.pop())
print(myset.pop())
print(myset.pop())

print(myset)
Output:
1357{9, 11}[Finished in 0.011040901998057961s]

The following shows an example with an empty set.

ExampleEdit & Run
myset = {1}

print(myset.pop())
print(myset.pop())
Output:
1Traceback (most recent call last):  File "<string>", line 4, in <module>KeyError: 'pop from an empty set'[Finished in 0.01019461010582745s]

pop() vs remove()

While the pop() method removes an arbitrary element, the remove() method  removes the element specified as an argument from the set. It also raises a KeyError if the element is not present.

ExampleEdit & Run
myset = {1, 3, 5, 6, 7, 8}

myset.remove(6)
myset.remove(8)

print(myset)
Output:
{1, 3, 5, 7}[Finished in 0.010161706944927573s]