In Python 3.6:
d = {0: None}
for i in d:
del d[i]
d[i+1] = None
print(i)
The output is
0
1
2
3
4
In Python 2.7 the output goes up to 7
. What causes this output?
In Python 3.6:
d = {0: None}
for i in d:
del d[i]
d[i+1] = None
print(i)
The output is
0
1
2
3
4
In Python 2.7 the output goes up to 7
. What causes this output?