I have a dictionary with key-value pair. My value contains strings. How can I search if a specific string exists in the dictionary and return the key that correspond to the
def search(myDict, lookup): a=[] for key, value in myDict.items(): for v in value: if lookup in v: a.append(key) a=list(set(a)) return a
if the research involves more keys maybe you should create a list with all the keys