title: Removing all empty elements from a list
body: <p>Why does my code not remove the last empty element in the list?</p>
  
  <pre><code>templist = ['', 'hello', '', 'hi', 'mkay', '', '']
  
  for element in templist:
      if element == '':
          templist.remove(element)
  
  print (templist)
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>['hello', 'hi', 'mkay', '']
  </code></pre>