title: Reverse each word in a string
body: <p>I am having a small problem in my code. I am trying to reverse the words and the character of a string. For example "the dog ran" would become "ehT god nar"</p>
  
  <p>The code almost works. It just does not add spaces. How would you do that? </p>
  
  <pre><code>def reverseEachWord(str):
    reverseWord=""
    list=str.split()
    for word in list:
      word=word[::-1]
      reverseWord=reverseWord+word+""
    return reverseWord 
  </code></pre>