Home>Article>Backend Development> What is the usage of python end?
What is the usage of python end?
Syntax: The following is the syntax of the print() method:
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
Using the end parameter effect
Return value: The print() function has no return value
The following are a few small demos for your reference
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!