Python 3.4 - Dictionary Multiple Key Sort

You can sort data and use it for different purposes:

from operator import itemgetter

user = {'fname': 'Matt', 'lname': 'Fassnacht'}, {'fname': 'Jim', 'lname': 'Fassnacht'}


for x in sorted(user, key=itemgetter('fname')):
    print(x)


https://www.youtube.com/watch?v=avthXghx0a0

Comments

Popular posts from this blog

Python 3.4 - Dictionaries

Huddled Yearning Masses: Critical Thinking

Changes in the Academic Conversation: Trevelyan's 3 Functions of History