title: Sorting Python list based on the length of the string
body: <p>I want to sort a list of strings based on the string length. I tried to use sort as follows, but it doesn't seem to give me correct result.</p>
  
  <pre><code>xs = ['dddd','a','bb','ccc']
  print xs
  xs.sort(lambda x,y: len(x) &lt; len(y))
  print xs
  
  ['dddd', 'a', 'bb', 'ccc']
  ['dddd', 'a', 'bb', 'ccc']
  </code></pre>
  
  <p>What might be wrong?</p>