Python‎ > ‎str‎ > ‎

str.rjust()


Definition
Return S right-justified in a string of length width. Padding is done using the specified fill character (default is a space).

Syntax
S.rjust(width[, fillchar]) -> str

Parameters
s=string
width=numeric
filchar=value

Examples
The return are as follow:
 >>> "Python Lake learning Centre".rjust(55)
' Python Lake learning Centre'
>>> "Python".rjust(10)
' Python'
>>>

The returns are :
 >>> type("Python".rjust(10))
<class 'str'>
>>> "Python".rjust(10).__eq__('    Python')
True
>>> len('    Python')
10
>>> len("Python".rjust(10))
10
>>> 

Comments