capitalize() string method in Python

The capitalize string method capitalizes the first character of the string and makes all other characters lowercase.

Syntax string.capitalize()

Example:

Python

text = "ashish is a good boy. he Loves Swimming."
print(text.capitalize())   
# Output: Ashish is a good boy. he loves swimming.

Special Note: As string in Python is immutable, so any operation on it returns a new string.