• Fuzzy about one of the hints

Question related to mission Moore Neighbourhood

 

Can someone please explain in layman terms what this piece of code is doing:

    if 0 <= n_row < len(grid) and 0 <= n_col < len(grid[n_row]):
        if grid[n_row][n_col]:
            count += 1

return count