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>Let's use an even more appropriate function for this: <a href="https://docs.python.org/2/library/string.html#string.capitalize" rel="nofollow"><code>string.capitalize</code></a></p>

<pre><code>&gt;&gt;&gt; s="OPERATOR FAIL TO PROPERLY REMOVE SOLID WASTE"
&gt;&gt;&gt; s.capitalize()
'Operator fail to properly remove solid waste'
</code></pre>

python