Python training topics

written in front

The oj of the school's python class training platform is too sensitive, and if there is one missing space, an error will be reported-answer-oriented programming. In order to commemorate the little but suffering experience in the python practical class, the code is saved on the blog.
I would rather brush leetcode than run python code

2.1 Expressions and basic input and output

2.1.1 Data input and output

Task description
The task of this level: output the value of the expression according to the requirements of the topic, and master the input and output of python data.

Relevant knowledge
To complete this level, you need to master the usage of print( ), input(), eval() functions.
print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)
Parameters:
objects – plural, indicating that multiple objects can be output at one time. 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 what to end with. The default value is the newline character \n, we can replace it with other strings.
file – the file object to write.
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.
Example:

print(1)
1
print(“Hello World”)
Hello World

Guess you like

Origin blog.csdn.net/Algernon98/article/details/123491593