I'm trying to access the elements of a list of combinations as arrays, to be able to manipulate the results of the combinations.
a = 1
b = 2
c = 3
d = 4
comb = combinations_with_replacement([a, b, c, d], 2)
for i in list(comb):
print(i)
I have this code, the a, b, c, d
variables aren't going to be those specific values.
This returns:
(1, 1)
(1, 2)
(1, 3)
(1, 4)
(2, 2)
(2, 3)
(2, 4)
(3, 3)
(3, 4)
(4, 4)
I want to be able to access each of those combinations as a array to manipulate its elements, how do I do that?