Python String Testing

There are several methods to test the nature of characters in a string. These methods return either True or False. For example, if a string has only numeric digits, then isdigit() method returns True. These methods can also be applied to individual characters.

Method Description
isalnum() This method returns True if all characters in the string are alphanumeric (A to Z, a to z, 0 to 9) and there is at least one character; otherwise it returns False.
isalpha() Returns True if the string has at least one character and all characters are alphabetic (A to Z and a to z); otherwise, it returns False.
isdigit() Returns True if the string contains only numeric digits (0 to 9) and False otherwise.
islower() Returns True if the string contains at least one letter and all characters are in lower case; otherwise, it returns False.
isupper() Returns True if the string contains at least one letter and all characters are in upper case; otherwise, it returns False.
istitle() Returns True if each word of the string starts with a capital letter and there is at least one character in the string; otherwise, it returns False.
isspace() Returns True if the string contains only spaces; otherwise, it returns False.

Write a Python Program to check the given String