title: cleaning my list
body: <p>Hello I have a loop which goes counts different records in my MySQL database and then saves the numbers to a list. Here is the list:<br>
  <code>[1L, 2L, 2L, 5L, 4L, 1L, 1L, 1L, 3L, 1L, 1L, 2L, 2L, 3L, 3L, 1L, 2L, 4L, 2L, 1L, 3L, 1L, 2L, 4L, 1L, 2L, 1L, 1L, 3L, 1L, 3L, 1L, 5L, 2L, 1L, 1L, 5L, 1L, 1L, 1L, 4L, 2L, 1L, 3L, 2L, 1L, 2L, 2L, 2L, 3L, 1L, 1L, 3L, 2L, 2L, 1L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 2L, 1L, 3L, 3L, 1L, 2L, 1L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L]</code></p>
  
  <p>now I go thru this list and I want to leave only single numbers (means 1L, 2L etc) I'm using this loop:  <code><pre>for number in legend:
          print number # to check what number it does currently
          counter = legend.count(number)
          while counter > 1:
              legend.remove(number)
              counter -= 1 </pre></code></p>
  
  <p>then I see that it checks 1,2,3,4,3,2,1 ...why is that? why this loop wont check number 5? at the end the list looks like this:<br>
  <code>[5L, 5L, 5L, 4L, 3L, 2L, 1L]</code></p>
  
  <p>that means it works but why it doesn't go for number 5?</p>
  
  <p>thx in advance</p>