Given a list of e.g. two elements l = [1,0] I need to create all possible 5-element variations with repetitions. I've tried itertools.combinations but give me what I wanted.
With given n = 2 and k = 5 I should get 2^5 = 32 elements and the result should look like this:
results = [11111,11110,11101,11100,11001,11011,11010,...00000]