title: How can I copy a Python string?
body: <p>I do this:</p>
  
  <pre><code>a = 'hello'
  </code></pre>
  
  <p>And now I just want an independent copy of <code>a</code>:</p>
  
  <pre><code>import copy
  
  b = str(a)
  c = a[:]
  d = a + ''
  e = copy.copy(a)
  
  map( id, [ a,b,c,d,e ] )
  </code></pre>
  
  <p>Out[3]:</p>
  
  <pre><code>[4365576160, 4365576160, 4365576160, 4365576160, 4365576160]
  </code></pre>
  
  <p>Why do they all have the same memory address and how can I get a copy of <code>a</code>?</p>