The center() method creates and returns a new string which is padded with the specified character.
string.center(length[, fillchar]) Parameters: length: length of the string after padding with the characters. fillchar:(optional) characters which needs to be padded. If it's not provided, space is taken as default argument. Returns: returns a string padded with specified fillchar and it doesn't modify the original string.
After padding String is: geeks for geeks
After padding String is: ****geeks for geeks*****
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.