Created
April 10, 2019 10:30
-
-
Save codeslord/1144619f1bd31ad7c582753b1ddc8ca2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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