The endswith(), isdigit(), isalpha(), islower(), isupper(), and capitalize() methods
The endswith()methodchecks whether the given string ends with a specific character or word that we pass as an argument:
The isdigit()methodchecks whether the given string is of a digittypeor not:
The isalpha()methodchecks whether the given string is of an alphabetic charactertypeor not:
The islower()methodchecks whether the string is lowercase, while the isupper() method checks if the string is uppercase. The capitalize() method puts a given string into sentence case: