title: TypeError when using string.join() in Python
body: <p>I am writing a very simple function that, given a string as input, parses the string into sentences, reverses the words of each sentence, and returns the reversed sentences but in the given sentence order. I am struggling with the <code>string.split()</code> and <code>string.join()</code> built-in methods and am getting a TypeError when I run the following python program.</p>
  
  <pre><code>import string
  
  def reverseSentences(str):
      senList = str.split('.')
      for i, item in enumerate(senList[:]):
          senList[i] = string.join(item.split(' ').reverse(), ' ')
      return string.join(senList, '.') + '.'
  </code></pre>
  
  <p>When I try to print a call to this function it gives me a generic TypeError. Thanks for enduring my n00bishness.</p>