2 odpowiedzi
+ 1
This works the same way as Jan's example except you can target the specific key. You still have to redefine all of the values in the key, but you can add to it this way.
x = {'key0':'val0','key1':['val0','val1']}
for i in x:
print(x[i])
x['key1'] = ['val0','val1','val2']
print()
for i in x:
print(x[i])
0
i want do that by code not manually