Print () function in Python; input () function

print([object,...] [,seo = ‘ ’]  [, end = '\n'] [, file = sys.stdout])

sep:It means what character string is used to separate the output variables. If it is the default, the default is a space. It
end:means that it ends with a certain string, and the default is a new line.
file:Specifies the text object file to be transmitted, or other similar standard stream file; sys.stdout default
format string %d %s %(value; value);
wherein %4drepresents the output result is four strings, such as the four output string is not a space Placeholder.
%04dIt means that the output result is 4 character strings, if there are not enough 4 character strings, 0 is used to occupy the place.
for example:
Insert picture description here

input( prompt )

The prompt message prompt is displayed. It is the content entered by the user.
input( )The return value of the function is a string type, which can be int()replaced with an integer type through the function.
Insert picture description here

Published 36 original articles · praised 0 · visits 609

Guess you like

Origin blog.csdn.net/Corollary/article/details/105625277