In Python, the capitalize() method converts the first character of a string to capital (uppercase) letter. If the string has its first character as capital, then it returns the original string.
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 capital.
Below is the python program to illustrate capitalize() function:
Geeks for geeks GeeksForGeeks
- Python | Pandas Series.str.capitalize()
- numpy.defchararray.capitalize() in Python
- Capitalize first letter of a column in Pandas dataframe
- Python | Check if given string can be formed by concatenating string elements of list
- String slicing in Python to check if a string can become empty by recursive deletion
- Python | Check if string ends with any string in given list
- Python | Sorting string using order defined by another string
- Python | Check if a given string is binary string or not
- String slicing in Python to rotate a string
- Python | Add one string to another
- Python String | max()
- Python String | min()
- Python String
- String Formatting in Python using %
- Python | String translate()
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.