title: Counting occurrences in a loop
body: <pre><code>gzip_files=["complete-credit-ctrl-txn-SE06_2013-07-17-00.log.gz","complete-credit-ctrl-txn-SE06_2013-07-17-01.log.gz"]
  
  def input_func():
      num = input("Enter the number of MIN series digits: ")
      return num
  
  for i in gzip_files:
      import gzip
      f=gzip.open(i,'rb')
      file_content=f.read()
      digit = input_func()
      file_content = file_content.split('[')
      series = [] #list of MIN
      for line in  file_content:
          MIN = line.split('|')[13:15]
          for x in MIN:
              n = digit
              x = x[:n]
              series.append(x)
              break
  
  
      #count the number of occurences in the list named series
      for i in series:
          print i
      #end count
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>63928
  63928
  63929
  63929
  63928
  63928
  </code></pre>
  
  <p>That is only a part of the result. the actual result shows a really long list. Now i want to just list unique numbers and specify how many times it showed on the list. 
  So </p>
  
  <pre><code>63928 = 4, 
  63929 = 2
  </code></pre>