title: Removing all characters from python list except some capital letter
body: <p>I have a list in python which contains a lot of different characters, for example space, |, >, numbers, and small letters, but I only want to keep some capital letter (A,B,C,D). If I try this, it doesen't work, I almost get the desired list, but not only A,B,C,D remain.</p>
  
  <pre><code>with open("text.mfa") as f:
       content = f.read()
  mylist = list(content)
  
  letters = ['A','B','C','D']
  i = 0
  while i &lt; (len(mylist)-1)
       if mylist[i] != letters[0] or letters[1] or letters[2] or letters[3]
              mylist.remove(mylist[i])
       i+=1
  </code></pre>