title: Nested loops skipping over items in list
body: <p>The objective I had was to remove all words in a list that contained letters from user input</p>
  <pre><code>import pandas as pd
  
  filtered = ['d','dd','ddd','dddd','ddddd','dddddd']
  filtered_lc = [x.lower() for x in filtered]
  
  str = input(&quot;Input wrong letters (enter blank to skip): &quot;)
  
  for word in filtered_lc:
      for letter in str:
          if letter in word and word in filtered_lc:
              filtered_lc.remove(word)
  
  
  df = pd.DataFrame(filtered_lc)
  print(&quot;-----------------------\n&quot;, df)
  </code></pre>
  <p>Desired output should be nothing</p>
  <p>Output I got:</p>
  <pre><code>-----------------------
           0
  0      dd
  1    dddd
  2  dddddd
  </code></pre>
  <p>Could anyone explain why it is only processing for the 1st, 3rd and 5th word in the list please? Thank you</p>