Tuesday, March 6, 2018

String capitalize() Method

String capitalize() Method in Python 3

It returns a copy of the string with only its first character capitalized.

Syntax       
str.capitalize()

Return Value :  string
Example
#!/usr/bin/python3

str = "hai, how are you?"
print ("str.capitalize() : ", str.capitalize())
Result
str.capitalize() : Hai, how are you?