Two options that don’t require copying the whole set:
for e in s:
break
# e is now an element from s
Or…
e = next(iter(s))
But in general, sets don’t support indexing or slicing.
Two options that don’t require copying the whole set:
for e in s:
break
# e is now an element from s
Or…
e = next(iter(s))
But in general, sets don’t support indexing or slicing.