i have a list of dictionary as below:
benefits = [{'BENEFITS': 'DEATH', 'name of benefits': 'abcxyz'}, {'BENEFITS': 'DEATH', 'name of benefits': 'qwerty'}]
i would like to get a value of 'BENEFITS' if the value of 'name of benefits' = 'abcxyz'.. Could you please assist on this ?
for i in benefits:
for k,v in i.items():
if v == "abcxyz":
print(v)
the expected output is if v == "abcxyz"
, output is 'DEATH'