-center() is a python string function which take two argument one is prefix and suffix and other one is length of required string.
Example-
string is s="mytext"
required string is --mytext--
by
s.center(10,"-")
program-
print("Enter any string")
s=input()
print("Enter prefix or suffix to add")
ps=input()
print("Enter length of required string")
n=int(input())
print("Original string is ",s)
print("Required string is ",s.center(n,ps))
print("String in center covered by 1 is ",s.center(10,'1'))
print("String in center covered by 2 is ",s.center(10,'2'))
print("Original length ",len(s))
print("Length will become ",len(s.center(10,'1')))
Enter any string
mytext
Enter prefix or suffix to add
A
Enter length of required string
16
Original string is mytext
Required string is AAAAAmytextAAAAA
String in center covered by 1 is 11mytext11
String in center covered by 2 is 22mytext22
Original length 6
Length will become 10