Home >Backend Development >Python Tutorial >Use of title() method in Python

Use of title() method in Python

不言
不言Original
2018-04-10 15:15:538139browse

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

  • ## NA

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

The following example shows the use of the title() method.

#!/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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn