fork download
  1. b = {}
  2. b[1] = 0
  3. c = 0
  4. for k in b.keys():
  5. if c < 10:
  6. b[c] = 1
  7. c += 1
  8. print(b)
  9.  
Runtime error #stdin #stdout #stderr 0.05s 9568KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "prog.py", line 4, in <module>
    for k in b.keys():
RuntimeError: dictionary changed size during iteration