i have a list with 1's and 0's. I want to know all possible combinations of them and store each combination in a list of lists. Why are they stored as Tuples, and how to change that ?
import itertools
bitcode = [0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1]
# print(len(bitcode))
listoflist = [[]]
combo_all = itertools.combinations_with_replacement(bitcode, 11)
for bitcode in combo_all:
listoflist.append(bitcode)
# print(listoflist)
# print(len(listoflist))
# print(type(listoflist))
print(listoflist[-1])
print(type(listoflist[-1]))
(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
<class 'tuple'>