Python String capitalize() MethodLast 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 SyntaxIt has the following syntax: ParametersIt does not required any parameter. Return TypeIt returns a modified string. Different Examples for Python String capitalize() MethodHere, we are going to take several examples to demonstrate the working of the string capitalize() Method in Python. Python String capitalize() Method Example 1Output: Old value: tpointtech New value: Tpointtech Python String Capitalize() Method Example 2What 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 3What 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 |
We request you to subscribe our newsletter for upcoming updates.