How do I make a dictionary with multiple keys to one value?

I have a question about a dictionary I want to make. My goal is to have multiple keys to a single value, like below:

dictionary = {('a', 'b'): 1, ('c', 'd'): 2}
assert dictionary['a'] == 1
assert dictionary['b'] == 1

Any ideas?

Leave a Comment