Explanation
The code is tricky! Here you are modifying the list that the generator wants to use.
Here is the key to understanding what is happening:
• The for loop uses the first array
• The if statement uses the second array
The reason for this oddity is that the conditional statement is late binding.
The output above shows you that the for loop is iterating over the original array, but the conditional statement checks the newer array.
The only number that matches from the original array to the new array is 49 , so the count is one, which is greater than zero. That’s why the output only contains [49]