Python String capitalize() Method

Last Updated:

Python String capitalize()

The capitalize() method converts the first character of a string to capital (uppercase) letter.

If the string has its first character as capital (uppercase), then it returns the original string.

Example

Python Compiler
txt = "wikimass.com is for programmers" x = txt.capitalize() print(x)

Syntax

txt.capitalize()

Parameter Value

No parameters

Return Value

ValueExplanation
String Returns a string where the first character is uppercase.

Share this Page

Meet the Author