When we do nums.pop(), nums becomes [1,2,3].
It's only once we do
print(list(f))
that
f = filter(lambda x: x in nums, nums)
gets evaluated and we get [1,2,3].
When we do nums.pop(), nums becomes [1,2,3].
It's only once we do
print(list(f))
that
f = filter(lambda x: x in nums, nums)
gets evaluated and we get [1,2,3].