Python String capitalize() Method

This function capitalizes the first character in a string. The character must be a letter a through z.

Syntax

Python
string.capitalize()

Example

Python
print('abc'.capitalize())
print('Abc'.capitalize())
print('1abc'.capitalize())

Output

Abc
Abc
1abc