Function Details: capitalize

Description


Return a capitalized version of the string.


Extended Description


The capitalize() method returns a copy of the string with its first character capitalized and the rest lowercased. This method doesn't modify the original string, as strings are immutable in Python.


Read More about capitalize from Python Documentation

Function Signature



Module: builtins

Class: str

Parameters



Return


Returns a new string with the first character capitalized and the rest lowercased.


Return Type


str

Output

Explanation

This example demonstrates the basic usage of capitalize(). It capitalizes the first letter of the string.