Python String center() Method
Python String center()
center() method returns a string which is padded with the specified character.
|width||Required||Specifies the total width of the string.|
|fill||Optional||Specifies the filler character. |
Default value is " " (whitespace)
|New string||Returns a string which is padded with the specified character.|
|Org string||Returns the original string, if width is less than or equal to length of the string.|
In the following example, we use "-" as the padding character.
Hi Developers, we almost covered 90% of String functions and Interview Question on Python with examples for quick and easy learning.
We are working to cover every Single Concept in Python.
Please do google search for:
Join Our Channel
This channel is primarily useful for Full Stack Web Developer.