(Python) 2D Array only last argument

I´ve got following problem:

arr = [[1, 2], [2, 3], [3, 4]]
arr.index(2)

The problem is that I want to get arr[0][1] as an output, but I don´t know how to declare that it should only search in the second part of the second dimension.



Read more here: https://stackoverflow.com/questions/64413667/python-2d-array-only-last-argument

Content Attribution

This content was originally published by Xyndra at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: