else: # check if the clicked tile was next to the blank spot blankx, blanky = getBlankPosition(mainBoard) if spotx == blankx + 1 and spoty == blanky: slideTo = LEFT elif spotx == blankx - 1 and spoty == blanky: slideTo = RIGHT elif spotx == blankx and spoty == blanky + 1: slideTo = UP elif spotx == blankx and spoty == blanky - 1: slideTo = DOWN
getSpotClicked() did not return
(None, None), then it will have returned a tuple of two integer values that represent the X and Y coordinate of the spot on the board that was clicked. Then the
elif statements on lines 5  to 12  check if the spot that was clicked is a tile that is next to the blank spot (otherwise the tile will have no place to slide).
getBlankPosition() function will take the board data structure and return the X and Y board coordinates of the blank spot, which we store in the variables
blanky. If the spot the user clicked on was next to the blank space, we set the
slideTo variable with the value that the tile should slide.