replace method for python strings : <p>I have a string S = 'spam'</p>

<p>When I use the method replace as S.replace('pa', 'xx')</p>

<pre><code>S.replace('pa', 'xx')
</code></pre>

<p>The output I get is -</p>

<pre><code>Out[1044]: "sxxm's"
</code></pre>

<p>Why then are the python strings known to be immutable ?</p>
