title: Count elements in a list without using Counter
body: <p>Should be returning a dictionary in the following format:</p>
  <pre><code>key_count([1, 3, 2, 1, 5, 3, 5, 1, 4]) ⇒ {
      1: 3,
      2: 1,
      3: 2,
      4: 1,
      5: 2,
  }
  </code></pre>
  <p>I know the fastest way to do it is the following:</p>
  <pre><code>import collections
  
  def key_count(l):
      return collections.Counter(l)
  </code></pre>
  <p>However, I would like to do it without importing <code>collections.Counter</code>.</p>
  <p>So far I have:</p>
  <pre><code>x = []
  def key_count(l):
      for i in l:
          if i not in x:
              x.append(i)
              
      count = []
      for i in l:
          if i == i:
              
  </code></pre>
  <p>I approached the problem by trying to extract the two sides (keys and values) of the dictionary into separate lists and then use <code>zip</code> to create the dictionary. As you can see, I was able to extract the keys of the eventual dictionary but I cannot figure out how to add the number of occurrences for each number from the original list in a new list. I wanted to create an empty list count that will eventually be a list of numbers that denote how many times each number in the original list appeared. Any tips? Would appreciate not giving away the full answer as I am trying to solve this! Thanks in advance</p>