Latest web development tutorials

Python capitalize () method

Python strings Python strings


description

Python capitalize () the first letter of the string into uppercase, lowercase the other letters change. For 8-bit byte coding required according to the local environment.

grammar

capitalize () method syntax:

str.capitalize()

parameter

  • no.

return value

This method returns a capitalized string.

Examples

The following example shows an example of capitalize () method:

#!/usr/bin/python

str = "this is string example....wow!!!";

print "str.capitalize() : ", str.capitalize()

Examples of the above output results are as follows:

str.capitalize() :  This is string example....wow!!!

Python strings Python strings