I need to be able to display a set of 1200 random combinations out of 36 nCr 10. Since there are 254,186,856 combinations from 36 nCr 10, I guess I won't be able to put all of those in a Python list.

How can I solve this issue? Should I use something other than Python, or look for a different algorithm? (I'm using this one right now: <http://docs.python.org/library/itertools.html?highlight=itertools.combinations#itertools.combinations>)

EDIT: The combinations must not be duplicates, as it wouldn't be an nCr problem anymore. Just thought I'd clarify that.

Here's the code so far...

```
def combinations(iterable, r):
# combinations('ABCD', 2) --> AB AC AD BC BD CD
# combinations(range(4), 3) --> 012 013 023 123
pool = tuple(iterable)
n = len(pool)
if r > n:
    return
indices = range(r)
yield tuple(pool[i] for i in indices)
while True:
    for i in reversed(range(r)):
        if indices[i] != i + n - r:
            break
    else:
        return
    indices[i] += 1
    for j in range(i+1, r):
        indices[j] = indices[j-1] + 1
    yield tuple(pool[i] for i in indices)

if __name__ == '__main__':
    teamList = list(combinations(range(36), 10))

```

After that, Python uses 2+ GB of my RAM but never seems to finish the computations.