How would I search a list within a dictionary and then retrieve the key? The lists are values of a dictionary and I'm trying to find a specific item within those lists and then return the key.
For example:
wanted_fruit = "granny_smith"
fruits = {
"oranges" : ["tangerine", "mandarin", "clementine", "blood_orange"],
"apples" : ["golden_delicious", "gala", "granny_smith", "rome"],
"melons" : ["watermelon", "honeydew", "cantaloupe"]
}
How would I get an output of apples (as "granny_smith" is within the apples list)?