isalnum() - Returns True if all characters in the string are alphanumeric

Returns True if all the characters in the string are alphanumeric.  This would be a-z, A-Z, and 0-9.  Punctuation, spaces, symbols, and other characters are not considered a letter or a number.

Example

Python
str1 = 'Abc123'
str2 = "Hello World!!!!"
print(str1.isalnum())
print(str2.isalnum())

Output

True
False