Skip to content

Instantly share code, notes, and snippets.

@codeslord
Created April 10, 2019 10:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codeslord/1144619f1bd31ad7c582753b1ddc8ca2 to your computer and use it in GitHub Desktop.
Save codeslord/1144619f1bd31ad7c582753b1ddc8ca2 to your computer and use it in GitHub Desktop.
pairs = set( [(0,1),(0,1),(1,0),(1,2),(1,0),(2,1)] )
set((a,b) if a<=b else (b,a) for a,b in pairs)
or
pairs = set(frozenset(p) for p in ((0,1),(0,1),(1,0)) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment