I'm having some trouble with this Python. I'm trying to sort a dictionary alphabetically, from min to max (with values) and from max to min (by values). How can I do this?
Note: I can't get max to min working
stocks = {
'GOOG': 520.24,
'FB': 331.28,
'XMZN': 89.72,
'APPL': 112.31
}
# for min to max
print(sorted(zip(stocks.values(), stocks.keys())))
# for alphabetically
print(sorted(zip(stocks.keys(), stocks.values())))
# for max to min
print(sorted(zip(stocks.values(), stocks.keys(), reverse))