/  zfill() method in Python String Module

zfill() method in Python String Module


zfill method in the string module start filling zero’s from left side in the string till the appearance of the first character or value. The zfill counts spaces as well like it counts characters or values.


Syntax:

str.zfill()


Example-1:

txt = "Quality is most important"
x = txt.zfill(40)
print(x)


Output :