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

New Ways of Conversing: The Kindle 2 and what I think it means

Huddled Masses Yearning: Teach the Controversy

Conversations Ongoing: A Bunch of Amateurs