Hi, @dimitriparra ,
A Python dictionary, which is of type
dict, is a hash table. Hash tables are considered to be unordered. A hash function is used to map each
dict key to a location, or "bucket", in memory, where the item with that key is stored. It is possible for more than one key to map to the same bucket, in which case, a data structure, such as a linked list, can be used to maintain the items in that bucket.
Schemes to store dictionary items are designed for efficiency, rather than to preserve an order that is meaningful to the user. Therefore, to reliably output or otherwise deal with
dict items in a desired order, one should sort or organize keys copied from a
dict into another data type, such as a
list, where the desired order can be maintained.
Though Codecademy presents Python 2.7.x, you can find relevant information at Python 3: 5.5. Dictionaries that might be of interest, most of which also applies to Python 2 versions.
For more general information on hash tables, see Wikipedia: Hash table and other sources via Google.