How to check if a value exists in a dictionary (python),type(iter(d.values()))