![image](/media/blog/8420487b-1f99-49c0-977f-01a68c7f8700.png)
Python zfill() method used for adding zero beginning of the string, until reaching the specified length.
Syntax :
string.zfill(length)
Here length paramitter is required.
Example :
y=str(30)
print(y.zfill(10))
Output:
0000000030
Python zfill() method used for adding zero beginning of the string, until reaching the specified length.
Syntax :
string.zfill(length)
Here length paramitter is required.
Example :
y=str(30)
print(y.zfill(10))
Output:
0000000030