title: How can you replace an item of list on python by index
body: <p>For whatever reason (I should be  using JS), I am using Python to create an encryption/decryption program. In the encryption program, spaces are carrots (^). In the decryption program I have:</p>
  
  <pre><code>msg = raw_input("Msg: ")
  dmsg = list(msg)
  for i in dmsg:
      if i == "^":
          dmsg[i] = " "
  print dmsg
  </code></pre>
  
  <p>When given the string "^^^", the output is... "TypeError: list indices must be integers, not Unicode". All I'm looking for is a function or statement.</p>