Question: Suppose I have a list of tuples like:

```
listTuples = [(0, 3), (5, 10), (2, 4)] 

```

I want to get the index of the tuple with the largest difference between the tuple elements

```
3 - 0 = 3
10 - 5 = 5
4 - 2 = 2

```

So I want 1 as return.

Currently I am doing the following but perhaps there is a better way (faster, fewer lines of code) to do it.

```
listTuples = [(0, 3), (5, 10), (2, 4)] 

k = 0
e = 0

for j, i in enumerate(listTuples):
    diff = i[1] - i[0]
    if k < diff:
        k = diff
        e = j
    else:
        pass

print(e)

```

Answer: 
You could use `index` method of the list object with `max` function. ie, 

```
>>> listTuples = [(0, 3), (5, 10), (2, 4)]
>>> listTuples.index(max(listTuples, key=lambda x: x[1] - x[0]))
1

```

Here `max(listTuples, key=lambda x: x[1] - x[0])` will return a tuple that has maximum difference and `index` method will find the index of this tuple from the original list.

ie, `listTuples.index((5, 10))`
I would recommend using `max()` function:

```
x = [abs(j - i) for i, j in listTuples]
print(x.index(max(x)))

```