Latest web development tutorials

Python3 isalpha () method

Python3 string Python3 string


description

Are Python isalpha () method to detect the string consists of only letters.

grammar

isalpha () method syntax:

str.isalpha()

parameter

  • no.

return value

If there is at least one character string and all the characters are letters it returns True, otherwise False

Examples

The following example shows isalpha () instance method:

#!/usr/bin/python3

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

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

Examples of the above output results are as follows:

True
False

Python3 string Python3 string