Python - Sort a list of dics by value of dict`s dict value
<p>I have a list that looks like this:</p>

<pre><code>persons = [{'id': 11, 'passport': {'id': 11, 'birth_info':{'date': 10/10/2016...}}},{'id': 22, 'passport': {'id': 22, 'birth_info':{'date': 11/11/2016...}}}]
</code></pre>

<p>I need to sort the list of persons by their sub key of sub key - their birth_info date.</p>

<p>How should I do it ?
Thanks</p>

<p>Try this</p>

<pre><code>from datetime import datetime


print(sorted(persons, key=lambda x: datetime.strptime(x['passport']['birth_info']['date'], "%d/%m/%Y"))) #reverse=True for descending order.
</code></pre>

python list sorting quicksort