From which Python version is preservation of dictionary insertion order a guaranteed language feature?
Correct answer C. Python 3.7
Explanation
Dictionaries are documented as preserving insertion order from Python 3.7 onwards. CPython 3.6 already behaved this way, but only as an implementation detail that other interpreters need not follow. Before that, collections.OrderedDict was needed when order mattered, and it still offers extra methods such as move_to_end().
Answer checked How we write and check questions
Discussion