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


#1

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?


#2

Hi,

Is this what you’re trying to accomplish?


#3

@hzamaniM54WP


#5

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