Latest web development tutorials

Python3 capitalize () method

Python3 string Python3 string


description

Python capitalize () the first letter of the string into uppercase, lowercase the other letters change.

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/python3

str = "this is string example from w3big....wow!!!"

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

Examples of the above output results are as follows:

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

Python3 string Python3 string