I have a list:
my_list = [\'abc-123\', \'def-456\', \'ghi-789\', \'abc-456\']
and want to search for items that contain the string \'
\'
Question : Give the informations of abc
a = ['abc-123', 'def-456', 'ghi-789', 'abc-456'] aa = [ string for string in a if "abc" in string] print(aa) Output => ['abc-123', 'abc-456']