ReferenceString methods
str.capitalize()
Upper-cases the first character and lower-cases the rest.
Signature
text.capitalize()Returns
A new string.
Example
Python
print("hELLO wORLD".capitalize())Output
Hello world
Basics
Strings
Collections
Functions
Classes and objects
Modules and the standard library
Files and errors
Beyond the basics
ReferenceString methods
Upper-cases the first character and lower-cases the rest.
text.capitalize()A new string.
print("hELLO wORLD".capitalize())Output
Hello world