The istitle() method checks whether all the case-based characters in the string following non-casebased letters are uppercase and all other case-based characters are lowercase.
Following is the syntax for istitle() method −
This method returns true if the string is a titlecased string and there is at least one character, for example uppercase characters may only follow uncased characters and lowercase characters only cased ones. It returns false otherwise.
The following example shows the usage of istitle() method.
#!/usr/bin/python3 str = "This Is String Example...Wow!!!" print (str.istitle()) str = "This is string example....wow!!!" print (str.istitle())
When we run above program, it produces the following result −
70 Lectures 8.5 hours
63 Lectures 6 hours