I have a dictionary in Python:
dict = {("s1", "a1"):1,("s1", "a2"):2,("s3", "a3"):3,("s1", "a3"):1}
Where key is a list(s, a) and value is an integer, so:
dict = {(s, a), i}
I want to pass in a specific s and return a where i is highest.
In the example above, I would expect to recieve "a2" if I passed in "s1".
So far I have the following:
print(max(dict, key=dict.get("s1"))[1])
However this is returning s3. How do I get this to work?