A
aspineux
Hello
I just want to update the data inside List or Dictionary without
adding or deleting object.
is this correct ?
l=[1, 2, 3]
for i, v in enumerate(l):
l=v+1
d=dict(a=1, b=2, c=3)
for k, v in d.iteritems():
d[k]=d[k]+1
Both works, but :
are they correct ?
are they optimum for big structure ?
Thanks
I just want to update the data inside List or Dictionary without
adding or deleting object.
is this correct ?
l=[1, 2, 3]
for i, v in enumerate(l):
l=v+1
d=dict(a=1, b=2, c=3)
for k, v in d.iteritems():
d[k]=d[k]+1
Both works, but :
are they correct ?
are they optimum for big structure ?
Thanks