Nico Grubert <nicogrub...@gmail.com> writes:

> Hi there
>
> I have the following list 'mylist' that contains some dictionaries:
>
> mylist = [{'title':'the Fog', 'id':1},
>           {'title':'The Storm', 'id':2},
>           {'title':'the bible', 'id':3},
>           {'title':'The thunder', 'id':4}
>          ]
>
> How I can sort (case insensitive) the list by the dictioary's 'title' key?

mylist.sort(key=lambda x: x['title'].lower())



   Florian
-- 
<http://www.florian-diesch.de/software/easygconf/>
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to