Created
March 30, 2015 15:36
-
-
Save rrichardson/cb312552a701d516c89e to your computer and use it in GitHub Desktop.
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
import itertools | |
def possible_combos(n, m): | |
ary = [0,0,0,0] | |
j = 0 | |
while j < m: | |
j += 1 | |
for i in range(n-1, -1, -1): | |
ary[i] = ary[i] + 1 | |
yield ary | |
for c in possible_combos(4, 10): | |
print c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment