demo_set_pop.py:
thisset = {"apple", "banana", "cherry"} x = thisset.pop() print(x) #removed item print(thisset) #the set after removal
➜ begtut>python demo_set_pop.py
cherry
{'apple', 'banana'}