Find dictionary keys with duplicate values

Viewed 73080
some_dict = {"firstname": "Albert", "nickname": "Albert", "surname": "Likins", "username": "Angel"}

I would like to return the keys of my dict where their value exists for more than one time.

Could some one show me how to implement this?

a_list = []
for k,v in  some_dict.iteritems():
    if v in some_dict.values() and v != some_dict.keys(k):
        a_list.append(k)
6 Answers
Related