Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
gh-106318: Add doctest role and 'See also' for str.zfill()
  • Loading branch information
adorilson committed Jan 15, 2026
commit fce429bd0871ff0dcc8cf561d4478fc696936a5f
6 changes: 5 additions & 1 deletion Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2842,13 +2842,17 @@ expression support in the :mod:`re` module).
than before. The original string is returned if *width* is less than
or equal to ``len(s)``.

For example::
For example:

.. doctest::

>>> "42".zfill(5)
'00042'
>>> "-42".zfill(5)
'-0042'

See also :meth:`rjust`.


.. index::
single: ! formatted string literal
Expand Down
Loading