Python3 capitalize() Method
Description
Python capitalize() changes the first letter of the 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 the first letter capitalized.
Example
The following example demonstrates the use of the capitalize() method:
Example
#!/usr/bin/python3
str = "this is string Example From Example....wow!!!"
print ("str.capitalize() : ", str.capitalize())
str = "this is string Example From Example....wow!!!"
print ("str.capitalize() : ", str.capitalize())
The output of the above example is:
str.capitalize() : This is string example from example....wow!!!
Other Extensions
Python3 Strings