Home >>Python String Methods >Python String rjust() Method
Python String rjust() Method in python returns the string right justify and fill the remaining spaces with specified fill character.
Syntax:string.rjust(length, character)
Parameter | Description |
---|---|
length | It is Required the width of the returned string |
character | It is Optional character to fill the missing space in the string. |
RJust = "five"
c = RJust.rjust(25)
print(c, "is my lucky number.")
five is my lucky number
str = 'phptpoint'
str = str.rjust(12,"O")
print(str)