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 with specified characters on the left until it reaches the specified length. If the length of the original string is already equal to or greater than the specified length, no padding is performed.
Technology Stack : String method
Code Type : String Handling Function
Code Difficulty : Intermediate
def zfill(arg1, arg2=0):
"""
返回一个字符串,该字符串在原始字符串的左侧填充了指定的字符,直到达到指定的长度。
如果指定的长度小于原始字符串的长度,则返回原始字符串。
"""
return arg1.zfill(arg2)