ljust()
Add left justified filler strings of specified width
my_string.ljust(width, filler)
width
: left justified string of width
filler
: optional, string can be used to fill the width
my_str='Welcome to'
output=my_str.ljust(15,'*')
print(output) # Welcome to*****
my_str='Welcome to'
output=my_str.ljust(5,'*')
print(output) # Welcome to
« All String methods « rjust()
← Subscribe to our YouTube Channel here
This article is written by plus2net.com team.
https://www.plus2net.com
plus2net.com