Python String capitalize() Method

Last Updated : 29 Dec 2025

In Python, the capitalize() method is used to convert the first character of the string into uppercase without altering the whole string. It changes the first character only and skips rest of the string unchanged.

Python String capitalize() Method Syntax

It has the following syntax:

Parameters

It does not required any parameter.

Return Type

It returns a modified string.

Different Examples for Python String capitalize() Method

Here, we are going to take several examples to demonstrate the working of the string capitalize() Method in Python.

Python String capitalize() Method Example 1

Output:

Old value: tpointtech
New value: Tpointtech

Python String Capitalize() Method Example 2

What if first character already exist in uppercase.

Output:

Old value: Tpointtech	
New value: Tpointtech

It returns the same string without any alteration.

Python String Capitalize() Method Example 3

What if first character is a digit or non-alphabet character? This method does not alter character if it is other than a string character.

Output:

Old value: #tpointtech
New value: #tpointtech
--------digit---------
Old value: 1-tpointtech
New value: 1-tpointtech
 
Next TopicPython Strings