title: How to remove a character from every string in a list, based on the position where a specific character occurs in the first member of said list?
body: <p>So I have a list of strings, all with the same length, like this:</p>
  <pre class="lang-py prettyprint-override"><code>list_strings=[&quot;A-C-TG--&quot;,&quot;ATCGTAGC&quot;,&quot;ATGCGATC&quot;,&quot;ATGCGGTC&quot;]
  </code></pre>
  <p>What I'm trying to do is, for each position where the first member of <code>list_strings</code> has a &quot;-&quot;, remove every character in those same positions from every member of <code>list_strings</code>.</p>
  <p>My output would be something like this:</p>
  <pre class="lang-py prettyprint-override"><code>new_list_strings=[&quot;ACTG&quot;,&quot;ACTA&quot;,&quot;AGGA&quot;,&quot;AGGG&quot;]
  </code></pre>
  <p>I've tried doing this:</p>
  <ol>
  <li>Creating an empty new list.</li>
  <li>Getting the positions where the first member of <code>list_strings</code> has a &quot;-&quot;.</li>
  <li>Remove the gap from all the strings and append the new string to &quot;new_list_strings&quot;</li>
  </ol>
  <pre><code>list_strings=[&quot;A-C-TG--&quot;,&quot;ATCGTAGC&quot;,&quot;ATGCGATC&quot;,&quot;ATGCGGTC&quot;]
  new_list_strings=[]
  positions=[i for i, letter in enumerate(list_strings[0]) if letter == &quot;-&quot;]
  for string in list_strings:
      for i in range(len(string)):
          for pos in positions:
              if i==pos:
                  string2=string[:i]+string[i+1:]
                  new_list_strings.append(string2)
  </code></pre>
  <p>Unfortunately, this is only removing on one of the positions and not all of them. Anyone knows what I'm doing wrong?</p>