Home >Backend Development >Python Tutorial >What does end='' mean in python?

What does end='' mean in python?

尚
Original
2019-06-27 10:53:1745327browse

What does end='' mean in python?

Pass an empty string for end, so that the print function will not add a newline character to the end of the string, but add an empty string. In fact, this is also a grammatical requirement. Indicates that the statement is not finished.

Print defaults to printing one line with a newline at the end. end=' 'means no line break at the end, add a space. Interactive mode, the effect is as follows:

>>> print('a')
a
>>> print('a',end=' ')
a 
>>> print('a',end='1234')
a1234
>>>

Example:

What does end= mean in python?

For more Python related technical articles, please visit the Python Tutorial column to learn !

The above is the detailed content of What does end='' mean 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