+ 1
can any one explain me this program how dictionary is updated
https://code.sololearn.com/cXGBghPJeFnr need a good explanation
3 Respuestas
+ 3
when loop runs first x[n] is assigned 'b'
So x[1]="b"
Then n is incremented and is 2 now
Again x[2] is assigned the next value in arr i.e. 'c'
So x[2]='c'
and so on
+ 1
Abhay... for x[n] in arr... Are we assigning array values to x[key]?
0
Gireesh Desineni yes
For example
When the following loop runs
for i in arr:
print(i)
What does i prints? All the values in arr and for it to do that each value from arr is assigned to i