Here's a solution that doesn't require all those \fontfamily{qcr}\selectfont
directives.

\documentclass[12pt]{article}
\usepackage{geometry}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{multirow}
%%%\usepackage{multicol} % not needed
\usepackage{longtable}
% new:
\usepackage{array,courier}
\begin{document}
\begin{longtable}{| l | >{\ttfamily}l | c |}
\hline
\textbf{Operation} & \multicolumn{1}{c|}{\textbf{Codes}} & \textbf{Output}\\
\hline
\endhead
% body of table:
\multirow{3}{*}{Transpose} &
A=Matrix([[1,2,3],[3,2,1],[1,1,5]]) &
\multirow{3}{*}{\small $
\begin{pmatrix}
1 &2 &3\\
3 &2 &1\\
1 &1 &5
\end{pmatrix}
$} \\
& B=A.transpose() & \\
& show(B) & \\
\hline
\multirow{2}{*}{Determinant} &
A=Matrix([[1,2,3],[3,2,1],[1,1,5]]) &
\multirow{2}{*}{$-16$}\\
& A.det() & \\
\hline
\multirow{3}{*}{Adjoint} &
A=Matrix([[1,2,3],[3,2,1],[1,1,5]]) &
\multirow{3}{*}{\small $
\begin{pmatrix}
1 &2 &3\\
3 &2 &1\\
1 &1 &5
\end{pmatrix}
$} \\
& B=A.adjugate() & \\
& show(B) & \\
\hline
\end{longtable}
\end{document}
Addendum to address the OP's follow-up query: The two main macros provided by LaTeX for drawing horizontal lines in table-like structures -- \hline
and \cline
-- are not particularly sophisticated. In particular, the spacing between lines drawn by \hline
and \cline
and the material above/below the lines is frequently woefully inadequate. You've encountered this yourself, haven't you?
Now, one could try a "bandaid approach" to fixing this issue, by inserting some vertical whitespace padding, by hand, above or below various lines. I would like to recommend that you consider doing something very different: Load the booktabs package and learn to use its user-level macros: \toprule
, \midrule
, \bottomrule
, \cmidrule
, and \addlinespace
. Whitespace can be every bit as effective at forming a visual separator as a black line can. A happy side-effect of using the macros of the booktabs
package is that it's hardly ever necessary to contemplate engaging in the kind of visual formatting you are mentioning in your follow-up comments.
Oh, getting rid of all vertical rules is also something that you should become very familiar with. Trust me, those vertical lines won't be missed.

\documentclass[12pt]{article}
\usepackage{geometry}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{multirow}
%%%\usepackage{multicol} % not needed
\usepackage{longtable}
% new:
\usepackage{array,courier,booktabs}
\begin{document}
\begin{longtable}{@{} l >{\ttfamily}l c @{}}
\toprule
\textbf{Operation} &
\multicolumn{1}{c}{\textbf{Codes}} &
\textbf{Output}\\
\midrule
\endhead
\bottomrule
\endlastfoot
% body of table:
\multirow{3}{*}{Transpose} &
A=Matrix([[1,2,3],[3,2,1],[1,1,5]]) &
\multirow{3}{*}{$
\begin{pmatrix}
1 &2 &3\\
3 &2 &1\\
1 &1 &5
\end{pmatrix}$} \\
& B=A.transpose() &\\
& show(B) & \\
\addlinespace
\multirow{2}{*}{Determinant} &
A=Matrix([[1,2,3],[3,2,1],[1,1,5]]) &
\multirow{2}{*}{$-16$}\\
& A.det() & \\
\addlinespace
\multirow{3}{*}{Adjoint} &
A=Matrix([[1,2,3],[3,2,1],[1,1,5]]) &
\multirow{3}{*}{$
\begin{pmatrix}
1 &2 &3\\
3 &2 &1\\
1 &1 &5
\end{pmatrix}$}\\
& B=A.adjugate() & \\
& show(B) & \\
\end{longtable}
\end{document}
\begin{longtable}{|c|c|c|}
so three centred columns usel
if you want left. same astabular
orarray
Codes
will also be left aligned which I was not seeking\multicolumn{1}{c|}{\textbf{Codes}}
will give a centred heading. don't use\pmb
!!!!