Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What does %.2d mean in Python? Wait online, thank you!
What does %.2d mean in Python? Wait online, thank you!
%d indicates that the output is an integer. .

%.2d indicates that the length of the output result is 2, those that do not meet the length are filled with 0, and those that meet and exceed the length of 2 are filled with themselves.

For example:

Print ("%.2d"% 3. 14 15) Result: 03.

Print ("%.2d"%3) Result: 03.

Print ("%.2d"% 123) Result: 123.