I have two lists as below
tags = [u\'man\', u\'you\', u\'are\', u\'awesome\'] entries = [[u\'man\', u\'thats\'],[ u\'right\',u\'awesome\']]
tags = [u'man', u'you', u'are', u'awesome'] entries = [[u'man', u'thats'],[ u'right',u'awesome']] result = [] [result.extend(entry) for tag in tags for entry in entries if tag in entry] print(result)
Output:
['man', 'thats', 'right', 'awesome']