title: How do I reverse words in a string with Python
body: <p>I am trying to reverse words of a string, but having difficulty, any assistance will be appreciated:</p>
  
  <pre><code>S = " what is my name"
  
  def reversStr(S):
      for x in range(len(S)):
          return S[::-1]
          break
  </code></pre>
  
  <p>What I get now is: <code>eman ym si tahw</code></p>
  
  <p>However, I am trying to get: <code>tahw is ym eman</code> (individual words reversed)</p>