Hi, so I have this piece of code that I want to get the row, column and value in a 2D array and print it but I have been stuck on it for some time so I would appreciate it if anyone can point out on whats wrong with it, thank you.

```
myNumbers = [[20, 25, 30, 35, 40], [2, 3, 4, 5, 6]]
for column in myNumbers:
for elem in column:
for row in range(len(myNumbers)):
for column in range(len(myNumbers[0])):
print("The value at row %s column %s is %s" % (row, column, elem))
```

## Output

The value at row 0 column 0 is 20

The value at row 0 column 1 is 20

The value at row 0 column 2 is 20

The value at row 0 column 3 is 20

The value at row 0 column 4 is 20

The value at row 1 column 0 is 20

The value at row 1 column 1 is 20

The value at row 1 column 2 is 20

The value at row 1 column 3 is 20

The value at row 1 column 4 is 20

The value at row 0 column 0 is 25

The value at row 0 column 1 is 25

The value at row 0 column 2 is 25

The value at row 0 column 3 is 25

The value at row 0 column 4 is 25

The value at row 1 column 0 is 25

The value at row 1 column 1 is 25

The value at row 1 column 2 is 25

The value at row 1 column 3 is 25

The value at row 1 column 4 is 25

The value at row 0 column 0 is 30

The value at row 0 column 1 is 30

The value at row 0 column 2 is 30

The value at row 0 column 3 is 30

The value at row 0 column 4 is 30

The value at row 1 column 0 is 30

The value at row 1 column 1 is 30

The value at row 1 column 2 is 30

The value at row 1 column 3 is 30

The value at row 1 column 4 is 30

The value at row 0 column 0 is 35

The value at row 0 column 1 is 35

The value at row 0 column 2 is 35

The value at row 0 column 3 is 35

The value at row 0 column 4 is 35

The value at row 1 column 0 is 35

The value at row 1 column 1 is 35

The value at row 1 column 2 is 35

The value at row 1 column 3 is 35

The value at row 1 column 4 is 35

The value at row 0 column 0 is 40

The value at row 0 column 1 is 40

The value at row 0 column 2 is 40

The value at row 0 column 3 is 40

The value at row 0 column 4 is 40

The value at row 1 column 0 is 40

The value at row 1 column 1 is 40

The value at row 1 column 2 is 40

The value at row 1 column 3 is 40

The value at row 1 column 4 is 40

The value at row 0 column 0 is 2

The value at row 0 column 1 is 2

The value at row 0 column 2 is 2

The value at row 0 column 3 is 2

The value at row 0 column 4 is 2

The value at row 1 column 0 is 2

The value at row 1 column 1 is 2

The value at row 1 column 2 is 2

The value at row 1 column 3 is 2

The value at row 1 column 4 is 2

The value at row 0 column 0 is 3

The value at row 0 column 1 is 3

The value at row 0 column 2 is 3

The value at row 0 column 3 is 3

The value at row 0 column 4 is 3

The value at row 1 column 0 is 3

The value at row 1 column 1 is 3

The value at row 1 column 2 is 3

The value at row 1 column 3 is 3

The value at row 1 column 4 is 3

The value at row 0 column 0 is 4

The value at row 0 column 1 is 4

The value at row 0 column 2 is 4

The value at row 0 column 3 is 4

The value at row 0 column 4 is 4

The value at row 1 column 0 is 4

The value at row 1 column 1 is 4

The value at row 1 column 2 is 4

The value at row 1 column 3 is 4

The value at row 1 column 4 is 4

The value at row 0 column 0 is 5

The value at row 0 column 1 is 5

The value at row 0 column 2 is 5

The value at row 0 column 3 is 5

The value at row 0 column 4 is 5

The value at row 1 column 0 is 5

The value at row 1 column 1 is 5

The value at row 1 column 2 is 5

The value at row 1 column 3 is 5

The value at row 1 column 4 is 5

The value at row 0 column 0 is 6

The value at row 0 column 1 is 6

The value at row 0 column 2 is 6

The value at row 0 column 3 is 6

The value at row 0 column 4 is 6

The value at row 1 column 0 is 6

The value at row 1 column 1 is 6

The value at row 1 column 2 is 6

The value at row 1 column 3 is 6

The value at row 1 column 4 is 6

## What I want

The value at row 0 column 0 is 20

The value at row 0 column 1 is 25

The value at row 0 column 2 is 30

The value at row 0 column 3 is 35

The value at row 0 column 4 is 40

The value at row 1 column 0 is 2

The value at row 1 column 1 is 3

The value at row 1 column 2 is 4

The value at row 1 column 3 is 5

The value at row 1 column 4 is 6

I have also tried this but it didn’t seem to work so I probably didn’t use for loops properly

```
myNumbers = [[20, 25, 30, 35, 40], [2, 3, 4, 5, 6]]
for row in myNumbers:
for elem in row:
elem = elem
for row in range(len(myNumbers)):
for column in range(len(myNumbers[0])):
print("The value at row %d column %d is %s" % (row, column, elem))
```

## Output

The value at row 0 column 0 is 6

The value at row 0 column 1 is 6

The value at row 0 column 2 is 6

The value at row 0 column 3 is 6

The value at row 0 column 4 is 6

The value at row 1 column 0 is 6

The value at row 1 column 1 is 6

The value at row 1 column 2 is 6

The value at row 1 column 3 is 6

The value at row 1 column 4 is 6

## What I want

The value at row 0 column 0 is 20

The value at row 0 column 1 is 25

The value at row 0 column 2 is 30

The value at row 0 column 3 is 35

The value at row 0 column 4 is 40

The value at row 1 column 0 is 2

The value at row 1 column 1 is 3

The value at row 1 column 2 is 4

The value at row 1 column 3 is 5

The value at row 1 column 4 is 6