returns none if there is no valid move possiblemoves [for in moveslistif isspacefree(boardi)possiblemoves append(ithe chooserandommovefromlist(function is useful for the ai code later in the program the board parameter is list of strings that represents tic tac toe board the second parameter moveslist is list of integers of possible spaces from which to choose for exampleif moveslist is [ ]that means chooserandommovefromlist(should return the integer for one of the corner spaces howeverchooserandommovefromlist(will first check that the space is valid to make move on the possiblemoves list starts as blank list the for loop will iterate over moveslist the moves that cause isspacefree(to return true are added to possiblemoves with the append(method if len(possiblemoves! return random choice(possiblemoveselsereturn none at this pointthe possiblemoves list has all of the moves that were in moveslist that are also free spaces if the list isn' emptythen there' at least one possible move that can be made on the board but this list could be empty for exampleif moveslist was [ but the board represented by the board parameter had all the corner spaces already takenthe possiblemoves list would be [in that caselen(possiblemoveswill evaluate to and the function returns the value none this next section explains the none value the none value the none value is value that represents the lack of value none is the only value of the data type nonetype it can be useful to use the none value when you need value that means "does not existor "none of the abovefor examplesay you had variable named quizanswer which holds the user' answer to some true-false pop quiz question the variable could hold true or false for the user' answer you could set quizanswer to none if the user skipped the question and didn' answer it using none would be better because otherwise it may look like the user answered the question when they didn'