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

What does end='' mean in python?

Release: 2019-07-08 09:05:36
Original
45308 people have browsed it

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
>>>
Copy after login

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!

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