String Left Fill Function

  • Share this:

Code introduction


Return a string left-filled with the specified fill character up to the given width.


Technology Stack : string.zfill(width)

Code Type : String Handling Function

Code Difficulty :


                
                    
def zfill(string, width=0, fillchar=' '):
    """
    Return the string left filled with the specified fillchar up to the given width.
    """
    return string.zfill(width)