Python3 capitalize() Method
Description
Python capitalize() converts the first letter of a string to uppercase and the other letters to lowercase.
Syntax
Syntax of the capitalize() method:
str.capitalize()
Parameters
- none.
Return Value
This method returns a string with its first letter capitalized.
Example
The following example demonstrates the capitalize() method:
Example
#!/usr/bin/python3
str
=
"this is string Example From Runoob....wow!!!"
(
"str.capitalize() : "
,
str
.
capitalize
(
)
)
The output of the above example is:
str.capitalize() : This is string example from runoob....wow!!!
Python3 Strings