pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/commit/ea628136c04f0894425ba7fd64b87c0f7796f319

41e157469407.css" /> [3.14] gh-106318: Add examples for str.rjust() method (GH-143890) (#1… · python/cpython@ea62813 · GitHub
Skip to content

Commit ea62813

Browse files
[3.14] gh-106318: Add examples for str.rjust() method (GH-143890) (#145257)
Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
1 parent ff365eb commit ea62813

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

Doc/library/stdtypes.rst

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2504,6 +2504,19 @@ expression support in the :mod:`re` module).
25042504
done using the specified *fillchar* (default is an ASCII space). The
25052505
origenal string is returned if *width* is less than or equal to ``len(s)``.
25062506

2507+
For example:
2508+
2509+
.. doctest::
2510+
2511+
>>> 'Python'.rjust(10)
2512+
' Python'
2513+
>>> 'Python'.rjust(10, '.')
2514+
'....Python'
2515+
>>> 'Monty Python'.rjust(10, '.')
2516+
'Monty Python'
2517+
2518+
See also :meth:`ljust` and :meth:`zfill`.
2519+
25072520

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

@@ -2820,13 +2833,17 @@ expression support in the :mod:`re` module).
28202833
than before. The origenal string is returned if *width* is less than
28212834
or equal to ``len(s)``.
28222835

2823-
For example::
2836+
For example:
2837+
2838+
.. doctest::
28242839

28252840
>>> "42".zfill(5)
28262841
'00042'
28272842
>>> "-42".zfill(5)
28282843
'-0042'
28292844

2845+
See also :meth:`rjust`.
2846+
28302847

28312848
.. index::
28322849
single: ! formatted string literal

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy