Articles → PYTHON → Capitalize Function In PythonCapitalize Function In PythonIn this article, we will discuss capitalize function in Python.Purpose Capitalize function capitalizes the first character of the string and sets other characters as lowercase.Example Let us work on an example.message = "This IS THE TEST MESSAGE" print(str.capitalize(message))Here, except for the first word all other words are in upper case. Output Posted By - Karan Gupta Posted On - Wednesday, February 20, 2019 Query/Feedback Your Email Id** Subject* Query/Feedback Characters remaining 250**
message = "This IS THE TEST MESSAGE" print(str.capitalize(message))
Query/Feedback