title: How to organize list by frequency of occurrence and alphabetically (in case of a tie) while eliminating duplicates?
body: <p>Basically if given a list:</p>
  
  <pre><code>data = ["apple", "pear", "cherry", "apple", "pear", "apple", "banana"]
  </code></pre>
  
  <p>I'm trying to make a function that returns a list like this:</p>
  
  <pre><code>["apple", "pear", "banana", "cherry"]
  </code></pre>
  
  <p>I'm trying to make the return list ordered by most frequently occurring word first while breaking ties by ordering them alphabetically.  I also am trying to eliminate duplicates.</p>
  
  <p>I've made lists already of the counts of each element and the indices of each element in data.</p>
  
  <pre><code>x = [n.count() for n in data]
  z = [n.index() for n in data]
  </code></pre>
  
  <p>I don't know where to go from this point.</p>