The pop method
The pop method removes the first element from a set. Since there is no ordered placement of elements in the set, it is impossible to say exactly which element will be removed. We do not specify anything in the method parameter.
Syntax
set.pop()
Example
Let's remove the first element from our set:
st = {'a', 'b', 'c'}
st.pop()
print(st)
Result of code execution:
{'b', 'c'}
Example
Now let's perform the same operation again:
st = {'a', 'b', 'c'}
st.pop()
print(st)
This time after running the code we got a different result:
{'a', 'c'}