I have the following lists below:
x1 = ['Apples:Red',
'Apples:Green',
'Bananas:Yellow',
'Grapes:Purple',
'Grapes:Green']
x2 = ['Green', 'Yellow']
I would like to check if the substring after the colon in list x1 matches with the any of the strings in x2.
Looking for an output like this:
['Apples:Green',
'Bananas:Yellow',
'Grapes:Green']