Articles → PYTHON → Capitalize function in pythonCapitalize function in pythonIn this article, we will discuss about capitalize function in pythonPurpose Capitalize function capitalize the first character of the string and set other characters as lower case.Example Let us work on an examplemessage = "This IS THE TEST MESSAGE"
print(str.capitalize(message))Here, except first word all other words are in upper case. Let us run the program and you will get following outputClick to EnlargePosted By - Karan Gupta Posted On - Wednesday, February 20, 2019
Your Email Id
Characters remaining 250
message = "This IS THE TEST MESSAGE"