def checkValid(s, row, col):
    """
    Returns True if a given cell is valid in a Sudoku puzzle, and
    False if not. A cell is valid if the number in that cell is not present
    in any of the cells in the same row, or the same column, or the same block.
    """
    block_row = row // 3
    block_col = col // 3

    # Row and Column
    # Ignore blank spots
    for m in range(9):
        if s[row][m] != 0 and m != col and s[row][m] == s[row][col]:
            return False
        if s[m][col] != 0 and m != row and s[m][col] == s[row][col]:
            return False

    # Block
    for m in range(3):
        for n in range(3):
            newRow = m + block_row*3
            newCol = n + block_col*3
            if s[newRow][newCol] != 0 and newRow != row and newCol != col\
            and s[newRow][newCol ] == s[row][col]:
                return False

    return True