This article mainly introduces the capitalize () method of the first letter of the word in Python, which is the basic knowledge in the introduction of Python, and the friends who need it can refer to
The capitalize () method returns a copy of the string, with only its first letter capitalized. For a 8-bit string, this method is related to the locale.
The following is the syntax for the Capitalize () method:
The string returned by this method has only a copy of its first character capitalization.
The following example shows the use of the Capitalize method.
|1 2 3 4 5||#!/usr/bin/python str = "This is string Example....wow!!!"; Print "Str.capitalize ():", Str.capitalize ()|
When we run the above program, it produces the following results: