title: Reversing words in a Python string (including punctuation)
body: <p>I wrote a program to reverse the words in a given sentence here:</p>
  <pre><code>def rev_each_word_in(Sentence):
  
  print(' '.join(Word[::-1] for Word in Sentence.split()))
  </code></pre>
  <p>As my input for Sentence I used &quot;to be or not to be that is the question.&quot; This returns the following:</p>
  <pre><code>ot eb ro ton ot eb taht si eht .noitseuq
  </code></pre>
  <p>It's almost exactly what I want, but is there a way that the period could remain at the end of the sentence, so the return would be:</p>
  <pre><code>ot eb ro ton ot eb taht si eht noitseuq.
  </code></pre>