keep asking the player until they enter number - move none while not isvalidspace(gameboardmove) print('what is {}\' move( - )format(currentplayer) move input('' updateboard(gameboardmovecurrentplayermake the move check if the game is over if iswinner(gameboardcurrentplayer)check for winner print(getboardstr(gameboard) print(currentplayer has won the game!' break elif isboardfull(gameboard)check for tie print(getboardstr(gameboard) print('the game is tie!' break switch turns to the next player currentplayernextplayer nextplayercurrentplayer print('thanks for playing!' def getblankboard() """create newblank tic-tac-toe board "" map of space numbers | | -+-+ | | -+-+ | | keys are through the values are xoor blank board { for space in all_spaces board[spaceblank all spaces start as blank return board def getboardstr(board) """return text-representation of the board "" return '' {}|{}|{ -+-+ {}|{}|{ -+-+ {}|{}|{ ''format(board[' ']board[' ']board[' '] board[' ']board[' ']board[' '] board[' ']board[' ']board[' '] def isvalidspace(boardspace) """returns true if the space on the board is valid space number and the space is blank "" return space in all_spaces and board[space=blank def iswinner(boardplayer) """return true if player is winner on this tttboard ""tic-tac-toe