Home > Backend Development > Python Tutorial > How to enter backslash in python

How to enter backslash in python

silencement
Release: 2019-05-22 13:36:34
Original
18771 people have browsed it

Through the previous study, we have mastered how to output single quotes in Python: two solutions, one is to put the single quotes within double quotes; the other is to use escape characters, that is, \. What should I do if I want to output backslashes?

How to enter backslash in python

##Output backslashes in Python:

For example, to output the three characters Bob, Lucy, and Mary names, and they are separated by \, we can do this:

How to enter backslash in python

The output result is exactly what we want! Here we also use the escape character \, and its output result is \. In this example, the first \ will escape the second \!

Look at another example

How to enter backslash in python

The result is directly output\.


The following are commonly used escape characters and their meanings

How to enter backslash in python

The above is the detailed content of How to enter backslash in python. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template