def uniq(x, k):
for key in x:
if (x.get(key) == x.get(k)):
if (x.get(key) == x.get(k)):
return False
return True
# Testing
d1 = {'a': 1, 'b': 2, 'c': 2, 'd': 4}
k = 'a'
x = uniq(d1, k)
print(x)
I am wondering how can I check an if statement twice. I need to figure out at parameter key k if there is a duplicate value in the dictionary. The output of this function should be True at key 'a' and at 'c' it should be False.