Python program to know who wins a tic-tac-toe game

Given an input where we have two players: “X” and “O”, and empty cells marked with a “.” like:

check_winner([ “X.O”, “XX.”, “XOO”])

the program outputs if there are three “X” or “O” in horizontal, vertical or diagonal. If there is a draw it outputs “D”.

expected results

def check_winner(game_result: List[str]) -> str:      for i, row in enumerate(game_result):         if game_result[i][0] == game_result[i][1] == game_result[i][2]:             if game_result[i][0] != ".":                 return game_result[i][0]         if game_result[0][i] == game_result[1][i] == game_result[2][i]:             if game_result[0][i] != ".":                 return game_result[0][i]      if game_result[0][0] == game_result[1][1] == game_result[2][2]:         if game_result[1][1] != ".":             return game_result[1][1]      if game_result[0][2] == game_result[1][1] == game_result[2][0]:         if game_result[1][1] != ".":             return game_result[1][1]      return "D" 

How could we improve this code?