Python String isalpha() Method Syntax

Syntax:  string.isalpha()

Parameters: isalpha() does not take any parameters

Returns:

  • True: If all characters in the string are alphabet.
  • False: If the string contains 1 or more non-alphabets.

Errors and Exceptions:

  1. It contains no arguments, therefore an error occurs if a parameter is passed
  2. Both uppercase and lowercase alphabets return “True”
  3. Space is not considered to be the alphabet, therefore it returns “False”

Python String isalpha() Method

Python String isalpha() method is used to check whether all characters in the String are an alphabet.

Similar Reads

Python String isalpha() Method Syntax

Syntax:  string.isalpha() Parameters: isalpha() does not take any parameters Returns: True: If all characters in the string are alphabet. False: If the string contains 1 or more non-alphabets. Errors and Exceptions: It contains no arguments, therefore an error occurs if a parameter is passed Both uppercase and lowercase alphabets return “True” Space is not considered to be the alphabet, therefore it returns “False”...

String isalpha() in Python Example

In this example, we have declared a string named as a string and we are checking that string only consists of alphabets....