title: Why doesn't calling a string method modify (mutate) the string? Why doesn't it change unless I assign the result?
body: <p>I try to do a simple string replacement, but I don't know why it doesn't seem to work:</p>
  
  <pre class="lang-python prettyprint-override"><code>X = "hello world"
  X.replace("hello", "goodbye")
  </code></pre>
  
  <p>I want to change the word <code>hello</code> to <code>goodbye</code>, thus it should change the string <code>"hello world"</code> to <code>"goodbye world"</code>. But X just remains <code>"hello world"</code>. Why is my code not working?</p>