Python String rjust() MethodPython Functions

The rjust() method returns a right-justified string of given minimum width.


# -*- coding: UTF-8 -*-

str = "Jason Statham is the most famous actor in Hollywood.!!!"
print (str.rjust(70, '*'))


***************Jason Statham is the most famous actor in Hollywood.!!!


string.rjust(width[, fillchar])


Name Description
width Width of the given string
fillchar Character to fill the remaining space of the width

Return Value

It returns the string right justified in a string of length width.

© 2021, all rights reserved. Privacy Policy | Contact Us