Python in format usage

Use the format function of python,

The new format is a format string python2.6 method, a method with respect to the old version of the format%, it has many advantages.

1 does not need to care about the data type of problem, a method in% in% s only replace string type

2. A single parameter can output a plurality of times, the order may not be the same parameter

3. Fill mode is very flexible, very strong alignment

4. official recommended way, way% will be eliminated in a later version

Published 25 original articles · won praise 3 · Views 491

Guess you like

Origin blog.csdn.net/qq_44045101/article/details/100864191