C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
Python String rjust() MethodPython rjust() method right justify the string and fill the remaining spaces with fillchars. This method returns a new string justified right and filled with fillchars. Signaturerjust(width[, fillchar]) Parameters
ReturnIt returns a right justified string. Let's see some examples of rjust() method to understand it's functionalities. Python String rjust() Method Example 1# Python rjust() method example # Variable declaration str = 'TheDeveloperBlog' # Calling function str = str.rjust(20) # Displaying result print(str) Output:
Python String rjust() Method Example 2# Python rjust() method example # Variable declaration str = 'TheDeveloperBlog' # Calling function str = str.rjust(15,"$") # Displaying result print(str) Output:
Next TopicPython Strings
|