isalpha() Function in python – Check for alphabetic character

isalpha() Function in python checks whether the string consists of alphabetic characters.lets see an example of python isalpha() Function

Syntax for isalpha() Function in Python:

str.isalpha()

Returns true if alphabetic character found else returns false.

 

Example of isalpha() Function in python:

# test the presence of Alphanumeric character
str1 = "2018isontheway"; #no space in the string
print str1.isalpha()

str1 = "Getreadypeople";
print str1.isalpha()

output will be

False

True

 

previous isalpha() Function in python                                                                                                           next isalpha() Function in python

Author

  • Sridhar Venkatachalam

    With close to 10 years on Experience in data science and machine learning Have extensively worked on programming languages like R, Python (Pandas), SAS, Pyspark.