8/13 Keeping Track of the Produce - Why is "orange" printed first?


#1

https://www.codecademy.com/courses/learn-python/lessons/a-day-at-the-supermarket/exercises/keeping-track-of-the-produce-?action=lesson_resume

I wrote the code correctly, and it passed me (green checkmark, yay), but I don’t understand why my results print in the order

orange, pear, banana, apple

when the dictionaries are ordered “banana”, “apple”, “orange”, “pear”



Replace this line with your code. 



#2

dictionaries are unordered by nature (except from python3.6 and onwards), given dictionaries are accessed by key, dictionaries don’t have to be ordered, if you want an ordered dictionary use ordered dictionary from collections:

https://docs.python.org/2/library/collections.html

why dictionaries are no longer unordered in python3.6? Seems they found a way to make them ordered and still fast enough (they changed the implementation of dictionaries in python)


#3

I think I see how that works now. Thanks. :slight_smile:


#4