I want to create a dictionary with {k:[list]}
where k
value of i
for the first iteration, it works but {3:[20,20,20]}
but when increase and added to the dictionary
{3:[20,20,20,20],4:[20,20,20,20]}
instead of {3:[20,20,20],4:[20,20,20,20]}
and goin
{3:[20,20,20,20,20],4:[20,20,20,20,20],5:[20,20,20,20,20]}
instead of
{3:[20,20,20],4:[20,20,20,20],5:[20,20,20,20,20]}
d0 = 20
tempsq=[]
c=[]
anon={}
minm=0
for i in range(3,len(sq)):
if i<2*kd:
# print(i)
cost=compute_I(sq[0:i])
c.append(cost)
#from hear
tempsq.clear()
for j in range(0,i):
tempsq.append(d0)
if not anon:
anon = {i: tempsq}
print(anon)
else:
anon.update({i:tempsq})
print(anon)
print(anon)