Home >Backend Development >Python Tutorial >Use of title() method in Python
This article mainly introduces the use of the title() method in Python. Now I share it with you. Friends who need it can refer to it
The title() method returns the first character of all words in capital letters. A copy of the string.
Syntax
The following is the syntax of the title() method:
str.title();
Parameters
Return value
This method returns the first few words of all words The characters are all uppercase and are a copy of the string.
Example
#!/usr/bin/python str = "this is string example....wow!!!"; print str.title();When we run the above program, it will produce the following results:
This Is String Example....Wow!!!Related recommendations:
Detailed explanation of the sort method in python
The above is the detailed content of Use of title() method in Python. For more information, please follow other related articles on the PHP Chinese website!