Categories
Python Answers

How to print a single backslash with Python?

Spread the love

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.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *