def get_position (row_index,col_index,size):
""" (int,int,int) -> int
Precondition:size >=col_index and size >= row_index
Return the str_index of the cell with row_index,col_index and size
>>>get_position (2,2,4)
5
>>>get_position (3,4,5)
13
"""
str_index = (row_index - 1) * size + col_index - 1
return str_index
def make_move(symbol,row_index,col_index,game_board):
"""(str,int,int,str) -> str
Return the resultant game board with symbol,row_index,col_index and game_board
>>>make_move("o",1,1,"----")
"o---"
>>>make_move("x",2,3,"---------")
"-----x---"
"""
length=len(game_board)
return "-"*(str_index-1)+symbol+"-"*(length-str_index)
Когда я оценил его, он показалошибка имени: ули-индекс не определен
"NameError: name 'str_index' is not defined"
Я думаю, что я уже определяю СИЛЫ-индекс.