File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff 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 original 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 original 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
You can’t perform that action at this time.
0 commit comments