The rjust()
method in Python is used to return a right-justified version of the string that is calling the method.
str.rjust(length, char)
This method requires the length
of the returned string to be passed as a parameter.
char
is an optional parameter used to fill the remaining space of width in the string.
string = "This is a string."print(string.rjust(30))
string = "This is a string."print(string.rjust(30, '0'))