title: String Transformation in Python
body: <p>How can I transform the string like this, I need to convert two double quotes to a \". </p>
  
  <pre><code>"Alexandra ""Alex""",Menendez,alex.menendez@gmail.com,Miami,1
  ["Alexandra \"Alex\"", "Menendez", "alex.menendez@gmail.com", "Miami", "1"]
  </code></pre>
  
  <p>the return should be a list and that's where I am landing into a problem. This is what I came up with</p>
  
  <pre><code>def parseCsv(sentence):
      result = []
      new_result = []
      sent_1 = list(sentence)
      new_str = ""
      new_w = ""
  
      for s in sent_1:
          if s != ',':
              new_str += " ".join(s)
          elif new_str:
              result.append(new_str)
              new_str = ""
      result.append(new_str)
  
      for i, w in enumerate(result):
          if w.startswith("\"") or w.endswith("\""):
              new_w += result[i]
              if new_w.startswith("\"") and new_w.endswith("\""):
                  x = new_w.replace('""', r'\"')
                  new_result.append(x)
                  new_w = ""
          else:
              new_result.append(w)
      return new_result
  </code></pre>
  
  <p>What I get back instead is</p>
  
  <pre><code>['"Alexandra \\"Alex\\""', 'Menendez', 'alex.menendez@gmail.com', 'Miami', '1']
  </code></pre>