title: Counting how many times a number appears in a file
body: <p>So I'm taking a file and running it through my code. Example of what appears on file per line:</p>
  
  <pre><code>100
  200
  300
  100
  200
  400
  </code></pre>
  
  <p>My goal is to get my code to iterate through the numbers in the file and the output is a dictionary with the number as the key and how ever many times it appears in the file as the value. For example:</p>
  
  <p>{100:2,200:2,300:1,400:1}</p>
  
  <p>This is what I've put together so far. </p>
  
  <pre><code>def counts(filename):
      d={}
      with open(filename) as f:
          for line in f
              for number in line:
  
  
      return d
  </code></pre>
  
  <p>Also,would I be able to use .count() for this? So could I create a list of numbers in the file and set those as the keys and then have a list for the set the corresponding amount of times each number appears and set that as the values to the keys?</p>