Python String capitalize() Method
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
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()
Let us compile and run the above program, this will produce the following result:
str.capitalize() : This is string example....wow!!!