dimanche 15 août 2021

I don't know what that error means and how to solve this. I want to add Country key and France value to the dictionary

dictionary_of_spliting = {"Food":"Honey",
                          "Trash1":"some",
                          "Trash2":"some",
                          "Trash3":"your",
                          "Thing":"resorces"}

for keys in dictionary_of_spliting:
    if var <= 12:
        dictionary_of_spliting["Country"] = "France"
Traceback (most recent call last)
  File "C:\Users\IK\PycharmProjects\More sting methods.py", line 20, in <module>
   for keys in dictionary_of_spliting:
RuntimeError: dictionary changed size during iteration

Aucun commentaire:

Enregistrer un commentaire