How to search if dictionary value contains certain string with Python
问题 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 key that contains the value. Let's say I want to search if the string 'Mary' exists in the dictionary value and get the key that contains it. This is what I tried but obviously it doesn't work that way. #Just an example how the dictionary may look like myDict = {'age': ['12'], 'address': ['34 Main Street, 212 First Avenue'