The capitalize() method in Python String returns a copy of the string that has its first character capitalized only. The capitalize() method in Python string is responsible for converting the first character of the string to uppercase i.e. capital letter. In case the string owns its first character as capital then this function would return the original string.
str.capitalize()
string
#!/usr/bin/python str = "this is string example....wow!!!"; print "str.capitalize() : ", str.capitalize()
str.capitalize() : This is string example....wow!!!
Here at Intellinuts, we have created a complete Python tutorial for Beginners to get started in Python.