Python isalpha

Python isalpha is one of the Python String Methods used to check whether the given string has at least one character, and the character is either an alphabet or not.

In this section, we discuss how to write string isalpha Function in Python Programming with example. The syntax of the string isalpha is

String_Value.isalpha()
  • String_Value: Please select a valid String literal.

Program to Check for an alphabet using Python isalpha

The following set of examples help you understand the string isalpha function. Please refer to the Python String and Python String Methods articles to understand the strings in Python.

# string isalpha Method Example

Str1 = 'TutorialGateway';
print('First Output of a isalpha() method is = ', Str1.isalpha())

# Performing isalpha() function on Empty Space
Str2 = '     ';
print('Second Output of a isalpha() method For Empty Space is = ', Str2.isalpha())

# Performing isalpha() function directly on Alphabets
Str3 = 'Python Tutorial at Tutorial Gateway'.isalpha()
print('Third Output of a isalpha() method is = ', Str3)

# Performing isalpha() on both Digits and Alphabets
Str4 = '1239abcd'.isalpha()
print('Fourth Output of a isalpha() method is = ', Str4)

# Performing isalpha() on Special Characters
Str5 = '@@@!!!!'.isalpha()
print('Fifth Output of a isalpha() method is = ', Str5)
Python isalpha function 1