z = (set(("a", "b", "c")) - set((x, y))).pop()
I am assuming that one of the three cases in your code holds. If this is the case, the set set(("a", "b", "c")) - set((x, y))
will consist of a single element, which is returned by pop()
.
Edit: As suggested by Raymond Hettinger in the comments, you could also use tuple unpacking to extract the single element from the set:
z, = set(("a", "b", "c")) - set((x, y))