I have this code
def array_combos(n,k):
arCombos = []
i = 0
a = [0]*k
while i > -1:
for j in range(i+1, k):
a[j] = a[j-1]+1
i=j
print(a)
arCombos.append(a)
while a[i] == i + n - k:
i -= 1
a[i] += 1
return arCombos
The print(a) print right values but list that function return is popolate by one single array n times. If I use yield insted of popolate list function work perfectly. Can we help? Tks