isalnum() Function in python – Check for alphanumeric character

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

 

Syntax for isalnum() Function in Python:

str.isalnum()

Returns true if alphanumeric character found else returns false.

 

Example of isalnum() Function in python:

# test the presence of Alphanumeric character

str1 = "2018isontheway"; #no space in the string
print str1.isalnum()

str1 = "Get ready people";
print str1.isalnum()

output will be

True
False

 

previous isalnum() Function in python                                                                                                                next isalnum() Function in python