一、print()
Print()
1.Print Directly
2.multi- objects format:,
3.separate of multi-obdects is space(default),is want others using sep=’ ’
4.After the function Print() there is a line wrapping(default), so if print null object like the example 4,the line wrapping operation will execude.
5.end=‘’ means after the function print() what’s the ending should be in order to concatenate the next command
二、String format print
%S means format print the String.
Fill it with the value of the variable
%d means format print the int.
For integer padding, we can padding 0 in front of the integer. such as %03d means 00? and %05d means 0000?
If the number itself exceeds the number of bits specified by the format character, nothing is changed
%f means format print float.
Specifies the number of decimal places
三、Format()
print(“. :{ }”.format( ))
For sequential , the format() function replaces the preceding placeholders one by one in order
For index , the format() function replaces the previous placeholder based on its index value
For argument , the format() function replaces the placeholder with the variable name of the placeholder;
For list , the format() function also replaces the list by its index;
For dictionary , the format() function replaces each entry by its key.
For class, the format() function replaces the class by its name.