Python 3.4 - Min, Max, and Sorting Dictionaries

 Dictionaries have two elements in them. A key (word) and a value (definition). If you want to sort these values you can. You can pull the max value, there's a lot you can do, let's look:

dict = {'goog': 540.43, 'yahoo': 456.45, 'amazon': 654.43}

print(min(zip(dict.values(), dict.keys())))

print(max(zip(dict.values(), dict.keys())))

print(sorted(zip(dict.values(), dict.keys())))


https://www.youtube.com/watch?v=U5I-2UZBOVg

Comments

Popular posts from this blog

Pyhton 3.4 - Continue

Conversations Ongoing: Valuing Modernization in Early European History

Conversations Ongoing: A Bunch of Amateurs