8/13: The order of items in dictionari and print is in diffrent order; why?


The order of key in prices and stock is: banana, apple, orange, peer. But in the print, the order of "for key in prices:" becomes: orange, pear, banana, apple. Why is the order different from the list in the dictionaries, the stock numbers and prices are correct, but not the order.


Dictionaries are not ordered in any manner, so when key:value pairs are called in a loop they will not be called in the order they are programmed into the dictionary.


Ok, thank you for the answer.