String capitalize
The method capitalize returns a new string with first letter capitalized.
Syntax
The format is:str.capitalize()
Parameters
None.
Example
str = "the capitalize method returns the string with first letter capitalized."
print( str.capitalize() )
Result:
The capitalize method returns the string with first letter capitalized.
Practice
Stop reading. Start writing Python.
PyChallenge gives you interactive exercises in your browser — no install needed.
Practice Python with interactive exercises