It returns a copy of the string with only its first character capitalized.
Following is the syntax for capitalize() method −
str.capitalize()
NA
string
#!/usr/bin/python3 str = "this is string example....wow!!!" print ("str.capitalize() : ", str.capitalize())
When we run above program, it produces the following result −
str.capitalize() : This is string example....wow!!!