Latest web development tutorials

Python isalpha () method

Python strings Python strings


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/python

str = "this";  # No space & digit in this string
print str.isalpha();

str = "this is string example....wow!!!";
print str.isalpha();

Examples of the above output results are as follows:

True
False

Python strings Python strings