How to get the index of filtered item in list using lambda?

Viewed 17015

I have a list of fruits [{'name': 'apple', 'qty': 233}, {'name': 'orange', 'qty': '441'}]

When i filter the list for orange using lambda, list(filter(lambda x: x['name']=='orange', fruits)) , i get the right dict but i can not get the index of the dict. Index should be 1 not 0.

How do i get the right index of the filtered item ?

enter image description here

1 Answers
Related