title: Comparing a list to a file and then counting every time that element appears in a list and putting it into a dictionary
body: <p>I have a list of political parties:</p>
  
  <pre><code>x = ['Green', 'Republicans' 'Democrats', 'Independent']
  </code></pre>
  
  <p>and then I have a file that lists out which district was won by the political party, there are roughly sixty entries. I have some starter code but I don't quite know how to continue on. </p>
  
  <pre><code>def party_winners (political_party, filename):
      winning_party = {}
      with open (filename,'r') as f:
          for line in f:
              results=line.split(',')
  </code></pre>
  
  <p>Basically all I want is to compare <code>x</code>, to every single list in my file, and see if something matches so if in the file Republicans won 50 times my dictionary will say: </p>
  
  <pre><code>winning_party = {'Republicans':50, 'Democrats': 35, 'Independents': 0}
  </code></pre>
  
  <p>I knew I forgot something my file is a list of </p>
  
  <pre><code>[county, votes, political party, person who ran] 
  </code></pre>