Articles → PYTHON → Center function in python

Center function in python






Purpose











Example


str = "this is string example"
print ("width is less than number of string characters -->", str.center(18, '*'))
print ("width is equal to number of string characters -->", str.center(22, '*'))
print ("width is one more than number of string characters -->", str.center(23, '*'))
print ("width is more than number of string characters -->", str.center(24, '*'))





Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Wednesday, February 20, 2019

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250