Home  >  Article  >  Backend Development  >  What is ╲t in python?

What is ╲t in python?

爱喝马黛茶的安东尼
爱喝马黛茶的安东尼Original
2019-06-20 11:20:1535549browse

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

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

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!

Statement:
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