title: Sorting numbers in string format with Python
body: <p>I have a list that has some chapter numbers in string.
  When I sort the keys using keys function, it gives me wrong results.</p>
  
  <pre>
  keys = ['1.1', '1.2', '2.1', '10.1'] 
  keys.sort() 
  print keys
  
  ['1.1', '1.2', '10.1', '2.1']
  </pre>
  
  <p>How can I use the sort function to get </p>
  
  <pre>
  ['1.1', '1.2', '2.1', '10.1']
  </pre>
  
  <p>What if the array has something like this?</p>
  
  <pre>
  ['1.1.1', '1.2.1', '10.1', '2.1'] -> ['1.1.1','1.2.1','2.1','10.1']
  </pre>
  
  <p></p>