PyDocs

Nav

Python Runtime Services

bytearray.zfill

  • bytearray.zfill(width, /)
Pad a numeric string with zeros on the left, to fill a field of the given width.

The original string is never truncated.
1 Example
>>> b"42".zfill(5)
b'00042'
>>> b"-42".zfill(5)
b'-0042'
from the Python docs
See Also
No see-alsos for builtins/bytearray.zfill
0 Notes
No notes for bytearray.zfill