Python title() Method | Tutorial
[Tutorial -- Learning not just skills, but dreams!](#)
- Home
- HTML
- JavaScript
- CSS
- Vue
- React
- Python3
- Java
- C
- C++
- C#
- AI
- Go
- SQL
- Linux
- VS Code
- Bootstrap
- Git
- Local Bookmarks
Python Basic Tutorial
Python Basic Tutorial Python Introduction Python Environment Setup Python Chinese Encoding Python VS Code Python Basic Syntax Python Variable Types Python Operators Python Conditional Statements Python Loop Statements Python While Loop Statement Python for Loop Statement Python Nested Loops Python break Statement Python continue Statement Python pass Statement Python Number Python Strings Python Lists Python Tuples Python Dictionary Python Date and Time Python Functions Python Modules Python File I/O Python File Methods Python Exceptions Python OS File/Directory Methods Python Built-in Functions
Python Advanced Tutorial
Python Object-Oriented Python Regular Expressions Python CGI Programming Python MySQL Database Operations Python Network Programming Python SMTP Email Sending Python Multithreading Python XML Parsing Python GUI Programming (Tkinter) Differences between Python2.x and 3.x Python IDE Python JSON Python AI Drawing Python 100 Examples Python Quiz
Python2.x Python title() Method
Description
The Python title() method returns a "titlecased" string, meaning all words start with an uppercase letter and the rest of the letters are lowercase (see istitle()).
Syntax
Syntax for the title() method:
str.title();
Parameters
- NA.
Return Value
Returns a "titlecased" string, meaning all words start with an uppercase letter.
Example
The following example demonstrates the use of the title() function:
#!/usr/bin/python
str = "this is string example....wow!!!";
print str.title();
The output of the above example is as follows:
This Is String Example....Wow!!!
YouTip