title: Dictionary Size Change During Iteration Error
body: <p>I'm writing a code to delete some items in a dictionary by selection, and even use a copy of the dictionary to prevent changing its size during iteration, but I keep getting this error:</p>
  
  <blockquote>
    <p>'RuntimeError: dictionary changed size during iteration'</p>
  </blockquote>
  
  <pre><code>import copy
  word = {'a':{'aa':{'aaa', 'aab'}, \
               'ab':{'aaa', 'aab'}}, \
          'b':{'ba':{'aaa', 'aab'}, \
               'bb':{'aaa', 'aab'}}, \
          'c':{'ca':{'aaa', 'aab'}, \
               'cb':{'aaa', 'aab'}}}
  wordCopy = copy.copy(word)
  for item in word.keys():
      for k in word[item].keys():
          print(k)
          print('Enter del to delete this item:')
          deleteCertificate = input()
          if deleteCertificate == 'del':
              del wordCopy[item][k]
  word = wordCopy
  print(word)
  </code></pre>