Python Code Challenges: Loops Delete Starting Even Numbers

https://www.codecademy.com/courses/learn-python-3/articles/python-code-challenges-loops

I wonder why lst.pop() does not get the correct solution for the second print statement, why the [10] did not eliminate?

When iterating a sequence, the index is established up front, such that removing an element will not refresh the starting index and items may be skipped over. Examine the effect more closely to see what we mean.

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.