In Python, the capitalize() method returns a copy of the original string and converts the first character of the string to a capital (uppercase) letter while making all other characters in the string lowercase letters.
string_name.capitalize() string_name: It is the name of string of whose first character we want to capitalize.
Parameter: The capitalize() function does not takes any parameter.
Return value: The capitalize() function returns a string with the first character in the capital.
Below is the python program to illustrate capitalize() function:
Geeks for geeks GeeksForGeeks
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.