What is ╲t in python?

爱喝马黛茶的安东尼
Release: 2019-06-20 11:20:15
Original
35545 people have browsed it

What is ╲t in python?\t in python refers to a descriptor, as shown below:

What is ╲t in python?

Usage example of \t in python:

Text is usually displayed against the left edge of the screen, but sometimes the user may want it to go a little further to the right. In text editing software, you can use the Tab key to achieve this effect. For strings, you can use the escape sequence \t to get such a tab character.

Related recommendations: "Python Video Tutorial"

Place it on the left:

>>> print("\t\t\tA B")
            A B
Copy after login

Three systems are used Tab escape sequence (\t). When the program outputs this string, it will print three tab characters first, and then A B. So A and B seem to be almost in the middle of the console window. The tab sequence can not only be used to set the position offset of the text, but also can be used to align the text.

Place it in the middle:

>>> print('fish\tc')
fish    c
Copy after login

The above is the detailed content of What is ╲t 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!