Convert UPPERCASE string to sentence case in Python
<p>How does one convert an uppercase string to proper sentence-case? Example string:</p>

<pre><code>"OPERATOR FAIL TO PROPERLY REMOVE SOLID WASTE"
</code></pre>

<p>Using <code>titlecase(str)</code> gives me:</p>

<pre><code>"Operator Fail to Properly Remove Solid Waste"
</code></pre>

<p>What I need is:</p>

<pre><code>"Operator fail to properly remove solid waste"
</code></pre>

<p>Is there an easy way to do this?</p>

<p>This will work for any sentence, or any paragraph. Note that the sentence must end with a <code>.</code> or it won't be treated as a new sentence. (Stealing <code>.capitalize()</code> which is the better method, hats off to brianpck for that)</p>

<pre><code>a = 'hello. i am a sentence.'
a = '. '.join(i.capitalize() for i in a.split('. '))
</code></pre>

python