PyDocs

Nav

Python Runtime Services

str.ljust

builtins

method of str
  • str.ljust(width, fillchar=' ', /)
Return a left-justified string of length width.

Padding is done using the specified fill character (default is
a space).
1 Example
>>> 'Python'.ljust(10)
'Python    '
>>> 'Python'.ljust(10, '.')
'Python....'
>>> 'Monty Python'.ljust(10, '.')
'Monty Python'
from the Python docs
See Also
No see-alsos for builtins/str.ljust
0 Notes
No notes for str.ljust