I have a Matrix that is consisted out of 80 cells. My objective is to test each of the possible combinations there are where each combination is 8 cells long.
For instance one of the possible combinations is [0, 1, 2, 3, 4, 5, 6, 7]
I was trying to use the following code to print each of these combinations and all I got was a MemoryError:
comb = combinations(range(80), 8)
for i in list(comb):
print(i)
My purpose is to actually take i (each combination) and set it in my device and verify it is functional. The print(i) was just intended to verify that I am doing it right and to see some of the combinations.
Is there a more memory efficient way to do this kind of task ?
By the way, I am aware that there are 2.898753715E+10 combinations that I am planning to test.