• Test doesn't meet preconditions

Question related to mission Moore Neighbourhood

 

Why would it try row value 5 when the grid has max row value as 4? I don't pass the test like this :(!

Am I doing somethign wrong? or is this a bug?

IndexError: tuple index out of range, countneighbours, 24 сountneighbours( ((1,0,1,0,1), (0,1,0,1,0), (1,0,1,0,1), (0,1,0,1,0), (1,0,1,0,1), (0,1,0,1,0),), 5, 4)