Python String title() MethodPython Functions


The title() method returns a string with the first letter of each word capitalized (a title cased string).

Example

#!/usr/bin/python3
# -*- coding: UTF-8 -*-

str = "this is a python website for beginners"
print(str.title())

Output:

This Is A Python Website For Beginners

Syntax

str.title()

Parameters

The method doesn’t take any parameters.

Return Value

It returns a title cased version of the string.

© 2021 Programtips.org, all rights reserved. Privacy Policy | Contact Us