title: Python: Count how many times a word occurs in a file
body: <p>I have a file that contains a city name and then a state name per line in the file. I am suppose to count how many times a state name occurs and return the value.</p>
  
  <p>for example, if my file contained:</p>
  
  <pre><code>Los Angeles   California
  San Diego     California
  San Francisco California
  Albany        New York
  Buffalo       New York
  Orlando       Florida
  </code></pre>
  
  <p>I am suppose to return how many times each state name occurs. I have this for California.</p>
  
  <pre><code>for line in f:
      California_count=line.find("California")
      if California_count!=-1:
          total=line.count("California")
  print(total)
  </code></pre>
  
  <p>This only gives me the value 1, which I am assuming is because it occurs 1 time per line. How do I get it to return the number 3 instead of the number 1?  </p>