Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-106318: Add examples for str.rjust() method#143890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
hugovk merged 2 commits intopython:mainfromadorilson:106318.rjust
Feb 26, 2026
Merged
Changes fromall 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 deletionDoc/library/stdtypes.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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 DownExpand 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

[8]ページ先頭

©2009-2026 Movatter.jp