How to remove multiple items from a Python list?

Let’s take it a step further. If you’re dealing with situations where you can’t use comprehensions or filter(), a more manual approach using a loop and remove() can come in handy. It’s a bit verbose but gives you precise control. For example:

item_list = ['item', 5, 'foo', 3.14, True]
items_to_remove = ['item', 'foo']
for item in items_to_remove:
    while item in item_list:
        item_list.remove(item)
print(item_list)

While this method works, remember that remove() only deletes the first occurrence, so using a while loop ensures all instances are removed. It’s not the most efficient for large lists, but it gets the job done when you need full control.