Home  >  Article  >  Backend Development  >  What is the usage of python end?

What is the usage of python end?

烟雨青岚
烟雨青岚Original
2020-06-16 14:08:5622023browse

What is the usage of python end?

What is the usage of python end?

Syntax: The following is the syntax of the print() method:

What is the usage of python end?

Parameters:

objects -- plural, indicating that multiple objects can be output at one time objects. When outputting multiple objects, they need to be separated by ,.

sep -- Used to separate multiple objects. The default value is a space.

end -- used to set the ending. The default value is the newline character \n, which we can change to other strings; "end=' '" means no newline at the end, but a space.

file -- The file object to be written.

flush -- Whether the output is cached is usually determined by the file, but if the flush keyword argument is True, the stream will be forced to be flushed.

Not using the end parameter effect

What is the usage of python end?

Using the end parameter effect

What is the usage of python end?

Return value: The print() function has no return value

The following are a few small demos for your reference

What is the usage of python end?

Notes:

(1) print is a function in Python3.x, but it is not a function in Python2.x version, just a keyword.

(2) The default value of end is the newline character \n.

Recommended tutorial: "python tutorial"

The above is the detailed content of What is the usage of python end?. 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