Skip to content
Advertisement

Find the index of a nested dict within a list base on the dict’s nested value

i have a list of dicts

JavaScript

how can i find the index of jane given only her phone number (8179482938)?

Advertisement

Answer

To get an index, you can do (lst is your list from question):

JavaScript

Prints:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement