---Restore content begins---
One, the variable
1) Variable assignment method
2)
Quick assignment: ctrl+d
Variable substitution shortcut: ctrl+r
3) String concatenation
Second, input-output
1 input
1) String output:
In this case, the output is all characters, and it is output as it is
2) Integer output
Add the evil() function:
In this case, the integer type can be output and can be operated. However, non-numeric characters such as letters cannot be entered, otherwise an error will be reported.
2 outputs
1) Format the output
2) Multiple variable output
3) output to a file
The program opens a file and operates on it accordingly. where w refers to writable
4) The output does not wrap automatically
The result is not wrapped:
5) Output each data, use the separator to separate
result:
6) flush use
result:
After 5s hibernation, the following content appears
After adding flush, the program will not sleep and execute immediately:
7) name() use
The last one is the use of the name method, which can be called the dictionary lookup method
8) width() use
Result: five places in total, right-aligned
Add "-" between %5d to align left:
Add a space (no matter how many) between %5d, and there is a space to the left, in order to align with negative numbers:
9) Number 0 padding using
If the display time is 04:08:
result:
It needs to be added between %d as follows:
result:
10) Precision printing
result:
result:
result:
result:
result:
11) Binary output and scientific notation output
binary:
result:
Octal:
result:
Hex:
result:
Scientific notation output:
result:
result:
---End of recovery content---