Skip to content
Open
Changes from all commits
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
19 changes: 18 additions & 1 deletion Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2554,6 +2554,19 @@ expression support in the :mod:`re` module).
done using the specified *fillchar* (default is an ASCII space). The
original string is returned if *width* is less than or equal to ``len(s)``.

For example:

.. doctest::

>>> 'Python'.rjust(10)
' Python'
>>> 'Python'.rjust(10, '.')
'....Python'
>>> 'Monty Python'.rjust(10, '.')
'Monty Python'

See also :meth:`ljust` and :meth:`zfill`.


.. method:: str.rpartition(sep, /)

Expand Down Expand Up @@ -2829,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