One question here: the combination of key:value is right, but every time I press run, the order of keys is different (espresso, chai, decaf, drip / chai, decaf, drip, espresso / decaf, drip, espresso, chai…), is that ok?
Yes. Order of insertion is not recallable, so not predictable. If order is required then you will need to reach for
OrderedDict. That will be for down the road, though as this exercise doesn’t need order.
I got the same results. The order is different when I use the lists vs the dictionary also. It is not alphabetical, or in numerical order. How do dictionaries assign order???
In the loosest of terms, they don’t. They’re generally regarded as unordered. As hashes there is more than one way to order them.
How do we want our dictionary ordered? Alphabetically, chronologically, etc.?