Here is the function that will tell you if there is any duplicates in Python dictionary values.
def has_duplicates(d):
return len(d) != len(set(d.values()))
print has_duplicates({'a': 1, 'b': 1, 'c': 2})
>> True
Here is the function that will tell you if there is any duplicates in Python dictionary values.
def has_duplicates(d):
return len(d) != len(set(d.values()))
print has_duplicates({'a': 1, 'b': 1, 'c': 2})
>> True