Sometimes, we want to print a single backslash with Python.
In this article, we’ll look at how to print a single backslash with Python.
How to print a single backslash with Python?
To print a single backslash with Python, we pass in '\\' into print.
For instance, we write:
print("\\")
And we see \ printed.
Conclusion
To print a single backslash with Python, we pass in '\\' into print.