title: How to sort a list by length of string followed by alphabetical order?
body: <blockquote>
  <p>Given a list of words, return a list with the same words in order of
  length (longest to shortest), the second sort criteria should be
  alphabetical. Hint: you need think of two functions.</p>
  </blockquote>
  <p>This is what I have so far:</p>
  <pre><code>def bylength(word1,word2):
      return len(word2)-len(word1)
  
  def sortlist(a):
      a.sort(cmp=bylength)
      return a
  </code></pre>
  <p>it sorts by length but I don't know how to apply the second criteria to this sort, which is by alphabetical descending.</p>