Created
June 5, 2016 10:55
-
-
Save brettfreer/8bfd46c957c9cce684dd870573c8e179 to your computer and use it in GitHub Desktop.
Return all 2 part combinations of a list
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
from itertools import combinations | |
def f(A): | |
for p in combinations(A, 2): | |
return p[0], p[1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment