Easy Tutorial
❮ Python String Reverse Python Os Listdir ❯

Python3 isalpha() Method

Python3 Strings


Description

The Python isalpha() method checks if the string consists only of letters or characters.

Syntax

The syntax for the isalpha() method is:

str.isalpha()

Parameters

Return Value

Returns True if the string has at least one character and all characters are letters or characters; otherwise, returns False.

Example

The following examples demonstrate the isalpha() method:

#!/usr/bin/python3

str = "tutorialpro"
print (str.isalpha())

# Letters and Chinese characters
str = "tutorialprotutorialpro.org"
print (str.isalpha())

str = "tutorialpro example....wow!!!"
print (str.isalpha())

The output of the above examples is as follows:

True
True
False

Python3 Strings

❮ Python String Reverse Python Os Listdir ❯