title: Python sorting multiple attributes
body: <p>I have a dictionary like the following. Key value pairs or username:name</p>
  
  <pre><code>d = {"user2":"Tom Cruise", "user1": "Tom Cruise"}
  </code></pre>
  
  <p>My problem is that i need to sort these by the Name, but if multiple users contain the same name like above, i then need to sort those by their username. I looked up the sorted function but i dont really understand the cmp parameter and the lambda. If someone could explain those and help me with this that would be great! Thanks :)</p>