I just ran your code and got the following result:
{'item_0': 'apples'}
{'item_0': 'apples', 'item_1': 'banana'}
{'item_0': 'apples', 'item_1': 'banana', 'item_2': 'oranges'}
{'item_0': 'apples', 'item_1': 'banana', 'item_2': 'oranges', 'item_3': 'peaches'}
{'item_0': 'apples', 'item_1': 'banana', 'item_2': 'oranges', 'item_3': 'peaches', 'item_4': 'tangerines'}
I can only assume there is something in your code that you have not shown us. Although I note from the documentation:
Quote:
It is best to think of a dictionary as an unordered set of key: value pairs
See also:
python sort dictionary - Google Search[
^].