I think the more important is the reason why the code iterate over a copy of the list.
In the loop you add the words with len > 6 to the list. You should not change the list you iterate over. In this particular case you will enter a infinite loop. If you delete elements from a list you iterate over - you will get unexpected results as some elements will never be used in the loop.
In the loop you add the words with len > 6 to the list. You should not change the list you iterate over. In this particular case you will enter a infinite loop. If you delete elements from a list you iterate over - you will get unexpected results as some elements will never be used in the loop.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs