String left just and right just will return left and right justified string as per width and fill character.
Syntax of Str.ljust & Str.rjust:
ljust(width,fill char)
rjust(width,fill char)
width will be an integer value & By default fill character is space and we can mention any other character of length one.it can not be more than one length otherwise it will raise an error.
As shown image above ljust returned string of len 13 and filled with g in right side of string. and right just will return string of length 13 padded with space on left side.
[…] Str.ljust: It returns left justified […]