I'm working on some python homework and I am asked to define a function that takes in a dictionary that maps bus routes to bus stops and returns a dictionary mapping bus stops to list of bus routes which stop at that stop. The input would be something like this:
{"Lentil": ["Chinook", "Orchard", "Valley", "Emerald","Providence",
"Stadium", "Main", "Arbor", "Sunnyside", "Fountain", "Crestview",
"Wheatland", "Walmart", "Bishop", "Derby", "Dilke"],
"Wheat": ["Chinook", "Orchard", "Valley", "Maple","Aspen", "TerreView",
"Clay", "Dismores", "Martin", "Bishop", "Walmart", "PorchLight",
"Campus"]}
I need to somehow make the values into keys and at the same time check if those values are values in any other key as well. Basically, I'm having a hard time trying to figure out how I can access the values and make them the new keys (no duplicates) without actually hard coding them.