Home >>Python String Methods >Python String isalnum() Method

Python String isalnum() Method

Python String isalnum() Method

Python String isalnum() Method in python programming language returns true if all the characters are alphanumeric or not.

Syntax:
string.isalnum()
Here is an Example of Python String isalnum() Method:

num = "phptpoint15"
z = num.isalnum()
print(z)

Output:
True
Example 2:

string = "xyz546"
print(string.isalnum()) 
string = "xyz 546"
print(string.isalnum())

Output:
True
False

No Sidebar ads