Monday, April 2, 2018

How to use isalpha( ) method to find alphabetic chars.?


String isalpha( ) Method

 The isalpha() method checks whether the string consists of alphabetic characters only.

Syntax

str.isalpha()
  

Return Value

This method returns true if all the characters in the string are alphabetic and there is at
least one character, false otherwise.

 Example

#!/usr/bin/python3

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

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

Result

True
False



<<< isalnum( )                       Go to Index                   isdigit( ) >>>