if isspacefree(board ) return move on one of the sides return chooserandommovefromlist(board[ ] def isboardfull(board) return true if every space on the board has been taken otherwise return false for in range( ) if isspacefree(boardi) return false return true print('welcome to tic tac toe!' while true reset the board theboard [' playerlettercomputerletter inputplayerletter( turn whogoesfirst( print('the turn will go first ' gameisplaying true while gameisplaying if turn ='player' player' turn drawboard(theboard move getplayermove(theboard makemove(theboardplayerlettermove if iswinner(theboardplayerletter) drawboard(theboard print('hoorayyou have won the game!' gameisplaying false else if isboardfull(theboard) drawboard(theboard print('the game is tie!' break else turn 'computer else computer' turn move getcomputermove(theboardcomputerletterpost questions to