Open this example in the interactive library
Source code
print(str(42).zfill(6))Sample output
000042

Pad an identifier. A self-contained example using the Python standard library.
Open this example in the interactive library
print(str(42).zfill(6))000042