isX() Methods

Similar to islower() and isupper() there are many isX() type methods.

  • isalpha() Returns True if the string consists only of letters and isn’t blank
  • isalnum() Returns True if the string consists only of letters and numbers and is not blank
  • isdecimal() Returns True if the string consists only of numeric characters and is not blank
  • isspace() Returns True if the string consists only of spaces, tabs, and newlines and is not blank
  • istitle() Returns True if the string consists only of words that begin with an uppercase letter followed by only lowercase letters

Note, the isX() methods are helpful for input validation.