Getting index of element in nested list and retrieving it using that index

Hey all,

In an exercise I’m trying to get the index of an element which may or may not be in a nested list. Then use that index to retrieve it down the track.

So simply put, it can look something like this:

In this example I want to know a way of getting the index of 5,45 and 16, where ever they are in the list, then use that index to retrieve the elements from that same list.

How would you do this?


Is this what you’re trying to accomplish?

1 Like


1 Like

Thanks @Lester.Pangan and @simoneavellini for the answers.