I have a list of brands:
brands = ['Nike', 'Reebok']
and a list of products:
products = ['Nike Air Max', 'Sony PS5', 'Samsung Galaxy S20', 'Apple Iphone 12', 'Air Jordan']
I need to check if any brand from the brands list was found in products list and then return new list of brands that were found.
I used a code from here.
brands_found = list(filter(lambda item: any(x in item for x in brands), products))
However it returns the items from products list. How can I change the code for it to return brands from brands list?