I have a list:
my_list = [\'abc-123\', \'def-456\', \'ghi-789\', \'abc-456\']
and want to search for items that contain the string \'
\'
my_list = ['abc-123', 'def-456', 'ghi-789', 'abc-456'] for item in my_list: if (item.find('abc')) != -1: print ('Found at ', item)