Skip to content

Instantly share code, notes, and snippets.

@rrichardson
Created March 30, 2015 15:36
Show Gist options
  • Save rrichardson/cb312552a701d516c89e to your computer and use it in GitHub Desktop.
Save rrichardson/cb312552a701d516c89e to your computer and use it in GitHub Desktop.
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