Python String zfill() Method
Fills the string with a specified number of 0 values at the beginning
Syntax
Python
Copy Code
string.zfill(number)
Parameters
Parameter | Description |
---|---|
number |
Required. The length of the string to be created |
Example
Python
Copy Code
print('123'.zfill(10))
Output
0000000123