Python approach to counting words in a string
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/4088265/word-frequency-count-using-python">Word frequency count using python</a>  </p>
</blockquote>



<p>I am attempting to iterate over a string word-by-word in order to count the number of times each word was used.</p>

<p>Here is my current thinking:</p>

<ol>
<li>Create a global dictionary object.</li>
<li>Iterate through the string word by word.</li>
<li>If the dictionary has a key for the word, increment the count.</li>
<li>If the dictionary doesn't have a key for the word, add one and set it to 1.</li>
</ol>

<p>I know Python has awesome libraries, so I am wondering if there is a better way to do this.</p>
