title: python counting and appending to list
body: <p>I'm trying to count how times something occurs in a list.  Is it possible to set a variable to move through each index and count it.  I want to append how many times each one is counter to a list.<br>
  I want it to look like this.  Forget the while loop, it's just to show that I'm looping this. 
  example.  And if possible to to import a library to make a shortcut, or if its the only way.</p>
  
  <pre><code>while True:
      index = 0
      L = ["brown", "brown", "brown", "red", "red", "yellow", "yellow"]
      numberOfTimes = L.count([index]) 
      index = index + numberOfTimes 
      numberOfTimesList.append(numberOfTimes)
  </code></pre>
  
  <p>I'd then want to make another list and so that I'd only see brown once like this:</p>
  
  <pre><code>["brown", "red", "yellow"] [3, 2, 2]
  </code></pre>