We can use the capitalize() function to capitalize the first character of a string. If the first character is already in capital then it returns the original string.
Syntax: string_name.capitalize() ex: n = “greatlearning” print(n.capitalize())
o/p: Greatlearning
In Python, you can use the capitalize() method to capitalize the first letter of a string. However, if a string already consists of a capital letter at the beginning, it will return the original string.