rjust() method in Python String Module
Syntax:
str.rjust()Parameters:
rjust() has 2 parameters.
- Width: it is the width of the given string. If it is less or equal to the original strung then it returns the original string.
- Fillchar: this is an optional parameter. It is used to fill in the empty spaces available in the string.
Example-1:
Using width
text = "Sahaydri"
x = text.rjust(27)
print(x, "are in North India.")
Output :

Example 2:
Using fillchar
string = 'New York'
width = 12
fillchar = '+'
print(string.rjust(width, fillchar))
Output:
