Why do
```
and
'''
produce outputs with different spaces?

\documentclass{article}
\parindent=0pt
\begin{document}
Input:
\begin{verbatim}
```\\
'''
\end{verbatim}
Output:
```\\
'''
\end{document}
Why do
```
and
'''
produce outputs with different spaces?

\documentclass{article}
\parindent=0pt
\begin{document}
Input:
\begin{verbatim}
```\\
'''
\end{verbatim}
Output:
```\\
'''
\end{document}
The TeX Book mentions (Chapter 2: Book Printing versus Ordinary Typing, p 5): "There's usually less space preceding a single left quote than there is preceding a double left quote. (Left and right are opposites.)"
As such, in the default Computer Modern font,
```\ \ldots\ '''
is interpreted as “‘ ... ”’ that has an opening double quote and a closing single quote, resulting in incorrect spacing. In these instances, Knuth suggests using

Outer double, inner single: ``\thinspace`\ \ldots\ '\thinspace'' \par
Outer single, inner double: `\thinspace``\ \ldots\ ''\thinspace'
fontencwith the[T1]encoding the spacing is the same for both. – Alan Munn Jul 04 '12 at 04:54