This is a follow-up on a previous question of mine regarding searching in lists of lists
I have a list with pairs of values as lists in it.
[['a',5], ['b',3], ['c',2] ]
I know the first element of each pair but I don't know the second (it's the result of a calculation and stored in the list with the first element. I sorted the list in descending order of the calculated item.
I want to know in which position each of the items is, which would normally be:
list.index('a')
if I didn't have the numbers there. Is there a way to get the index number without knowing the entirety of the element?
Something like:
list.index(['a',?])
where ?
is a wildcard?
Or should I just create a new list from the ordered one with just the first item in order to get it's index?