Python: Removing list element while iterating over list

I’m iterating over a list of elements in Python, do some action on it, and then remove them if they meet certain criteria. for element in somelist: do_action(element) if check(element): remove_element_from_list What should I use in place of remove_element? I have seen similar questions asked, but notice the presence of the do_action part that is … Read more