You can download this code by clicking the button below.
This code is now available for download.
This function is used to pad a string to a specified width, and if the length of the string is insufficient, it pads with the specified character on the left.
Technology Stack : String, rjust
Code Type : String Handling Function
Code Difficulty : Intermediate
def zfill(string, width=0, fillchar=' '):
return str(string).rjust(width, fillchar)