I need to access items nand a n+1list. For example, if my list was [1,2,3,4,5], and my n-th element was 2, I need the next item in the list 3.
In particular, I need to access these elements in order to use them to search for a value in matrix A
I have a for loop that repeats in a list:
list = [1,2,3,4,5]
for i in list:
value = A[i,i+1]
The problem is that I cannot perform an operation i+1to access an element of n+1my list. This is my first programming in Python, and I assumed that the access to the element would be the same as in C / C ++, but it is not. Any help would be appreciated.
source
share