3 ms·
Any reason why you're using a slice here? >>> numbers[:] = [n for n in numbers if not odd(n)] I'm thinking that doing >>> numbers = [n for n in numbers if not
by tom_jones 12y ago
Any reason why you're using a slice here?
>>> numbers[:] = [n for n in numbers if not odd(n)]
I'm thinking that doing
>>> numbers = [n for n in numbers if not odd(n)]
wouldn't be a problem since the assignment is executed after the computation of the list comprehension.