foob = {1:{'url':'www.abc.com', 'name':'abc'}, 2:{'url':'www.def.com', 'name':'def'}}
item = {'url':'www.abc.com', 'name':'wrong name'}
if item in foob.values():
print 'yes'
else:
print 'no'
I want to change item in list.values()
so that it only compares url
values and not whole dictionary. Is it possible to do that without iterating through whole dictionary there a simple way to do this without writing a separate for loop?