...

/

Modifying the Dictionary While Iterating Over It

Modifying the Dictionary While Iterating Over It

We'll cover the following...

Where does Christmas come before Thanksgiving?

⚠️ The following code is meant for Python 2.7 - 3.5 versions.

Press + to interact
x = {0: None}
for i in x:
del x[i]
x[i+1] = None
print(i)
...
...