Question PRG-PY-0080
HardWhy does modifying a dictionary while iterating over it raise RuntimeError?
- A.
Keys must be strings
- B.
It doesn't
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Python question
Why does modifying a dictionary while iterating over it raise RuntimeError?
Keys must be strings
It doesn't
Sign up free to see the answer and a step-by-step explanation.
Dictionaries are read-only
Changing its size invalidates the iteration order