You can create a new list containing all words that do not begin with one of your prefixes:
newlist = [x for x in list if not x.startswith(prefixes)]
The reason your code doesn't work is because the startswith method returns a boolean, and you are asking to remove that boolean from your list (but your list contains strings, not booleans).
Please note that it is usually not recommended to specify the list variable, since this is already the name of a predefined type list .
source share