Function Details: zfill

Description


Returns a copy of the string left filled with ASCII '0' digits to make a string of length width.


Extended Description


The zfill() method returns a copy of the string padded on the left with zeros ('0') to fill the specified width. If the string is already longer than the specified width, it is returned unchanged. The method preserves any sign prefix ('+' or '-') by moving it to the beginning of the resulting string.


Read More about zfill from Python Documentation

Function Signature



Module: builtins

Class: str

Parameters



Parameter List


  • width: int

Return



Return Type


str

Output

Explanation