The doc of set().pop()
says arbitrary element as shown below:
Remove and return an arbitrary element from the set. ...
But set().pop()
always removes and returns the 1st element in the set as shown below:
v = set({'A', 'B', 'C', 'D', 'E'})
print(v)
# {'E', 'D', 'B', 'A', 'C'}
print(v.pop()) # E
print(v.pop()) # D
print(v.pop()) # B
print(v.pop()) # A
print(v.pop()) # C
v = set({0, 1, 2, 3, 4})
print(v)
# {0, 1, 2, 3, 4}
print(v.pop()) # 0
print(v.pop()) # 1
print(v.pop()) # 2
print(v.pop()) # 3
print(v.pop()) # 4
The doc of set().pop()
should say the 1st element as shown below:
Remove and return the 1st element from the set. ...