I have this simple piece of code that returns what\'s in the title. Why doesn\'t the array simply print? This is not just an itertools issue I\'ve also notice
Try this:
for x in itertools.combinations(number, 4):
print x
Or shorter:
results = [x for x in itertools.combinations(number, 4) ]
Basically, all of the itertools module functions return this type of object. The idea is that, rather than computing a list of answers up front, they return an iterable object that 'knows' how to compute the answers, but doesn't do so unless `asked.' This way, there is no significant up front cost for computing elements. See also this very good introduction to generators.