Python String istitle() MethodPython Functions

Difficulty Level:
Difficulty Level:

The istitle() method checks if a string is titlecased. For titlecased string, the first letter of each word should be capitalized.

Example

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

s = 'Have A Nice Day!'
print(s.istitle())

s = 'Have a nice day!'
print(s.istitle())

Output:

True
False

Syntax

string.istitle()

Parameters

The method doesn’t take any parameters.

Return Value

It returns True or False, depending on whether the first letter of each word is capitalized.

Advertisement

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