It is possible to get index of particular element in list using index()
method, following way (borrowed from here):
>>> ["foo", "bar", "baz"].index('bar')
1
Is it possible to apply the same principle to nested structures (if not what is the closest most pythonic way)? The result should looks like this:
In [20]: list
Out[20]: [(0, 1, 2), (3, 4, 5)]
In [21]: list.someMagicFunctionHere(,4,)
Out[20]: 1