Chapters
Python114 chapters

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

See also