Created
February 15, 2013 20:01
-
-
Save xiaom/4963059 to your computer and use it in GitHub Desktop.
generate combinations
This file contains hidden or 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
# generate combinations | |
# | |
# http://docs.python.org/2/library/itertools.html#itertools.combinations | |
# | |
# combinations(iterable, r) --> combinations object | |
# Return successive r-length combinations of elements in the iterable. | |
combinations(range(4), 3) --> (0,1,2), (0,1,3), (0,2,3), (1,2,3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment