for key in list(mydict.keys()):
    if mydict[key] == value:
        if key not in reversed_dict[value]:
            reversed_dict[value].append(key)
How to reverse a dictionary that it has repeated values (python)