I am curious to know why?
r"\\"
print \\\\
Don't confuse with the immediate output of python and print
statements.
Hopefully, The following example will clarify your doubts.
In [5]: a = "a\nb"
In [6]: a
Out[6]: 'a\nb'
In [7]: print a
a
b
In [8]: a = r'\\'
In [9]: a
Out[9]: '\\\\'
In [10]: print a
\\
If your doubt is regarding raw string
(r''
represents raw string), this is a good read.
Quoting the essentials here:
A "raw string literal" is a slightly different syntax for a string literal, in which a backslash, \, is taken as meaning "just a backslash" (except when it comes right before a quote that would otherwise terminate the literal) -- no "escape sequences" to represent newlines, tabs, backspaces, form-feeds, and so on. In normal string literals, each backslash must be doubled up to avoid being taken as the start of an escape sequence.