You can download this code by clicking the button below.
This code is now available for download.
The zfill function is used to pad a string to a specified width, with 0 as the default width. If the string is shorter than the specified width, 0 is padded to the left of the string.
Technology Stack : str.zfill(width)
Code Type : String Handling Function
Code Difficulty :
def zfill(string, width=0):
return string.zfill(width)