0i_jmw
Last Updated: February 25, 2016
·
1.035K
· lukasz-madon
B2bc42f69510d6a1d2c9cde1c2214d24

Filtering list in-place with for comprehension in Python

my_list[:] = [x for x in my_list if predicate(x)]

Note the [:] after my_list

Say Thanks
Respond