def is_winner(board, letter):
    """Given a board and a player’s letter, this function returns True if
    that player has won."""
    return ((board[1] == letter and board[2] == letter and board[3] == letter) or # across the top
      (board[4] == letter and board[5] == letter and board[6] == letter) or # across the middle
      (board[7] == letter and board[8] == letter and board[9] == letter) or # across the bottom
      (board[1] == letter and board[4] == letter and board[7] == letter) or # down the left side
      (board[2] == letter and board[5] == letter and board[8] == letter) or # down the middle
      (board[3] == letter and board[6] == letter and board[9] == letter) or # down the right side
      (board[3] == letter and board[5] == letter and board[7] == letter) or # diagonal
      (board[1] == letter and board[5] == letter and board[9] == letter))