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 @@ -2353,6 +2353,19 @@ expression support in the :mod:`re` module).
23532353 done using the specified *fillchar * (default is an ASCII space). The
23542354 original string is returned if *width * is less than or equal to ``len(s) ``.
23552355
2356+ For example:
2357+
2358+ .. doctest ::
2359+
2360+ >>> ' Python' .rjust(10 )
2361+ ' Python'
2362+ >>> ' Python' .rjust(10 , ' .' )
2363+ '....Python'
2364+ >>> ' Monty Python' .rjust(10 , ' .' )
2365+ 'Monty Python'
2366+
2367+ See also :meth: `ljust ` and :meth: `zfill `.
2368+
23562369
23572370.. method :: str.rpartition(sep, /)
23582371
@@ -2669,13 +2682,17 @@ expression support in the :mod:`re` module).
26692682 than before. The original string is returned if *width * is less than
26702683 or equal to ``len(s) ``.
26712684
2672- For example::
2685+ For example:
2686+
2687+ .. doctest ::
26732688
26742689 >>> " 42" .zfill(5 )
26752690 '00042'
26762691 >>> " -42" .zfill(5 )
26772692 '-0042'
26782693
2694+ See also :meth: `rjust `.
2695+
26792696
26802697.. index ::
26812698 single: ! formatted string literal
You can’t perform that action at this time.
0 commit comments