The method capitalize() returns a copy of the string with only its first character capitalized. For 8-bit strings, this method is locale-dependent.
Following is the syntax for capitalize() method:
str.capitalize()
NA
This method returns a copy of the string with only its first character capitalized.
The following example shows the usage of capitalize() method.
#!/usr/bin/python
str = "this is string example....wow!!!";
print "str.capitalize() : ", str.capitalize()
When we run above program, it produces following result:
str.capitalize() : This is string example....wow!!!