Function Details: isalnum

Description


Return True if all characters in the string are alphanumeric and there is at least one character, False otherwise.


Extended Description


The isalnum() method checks if all the characters in the string are alphanumeric (letters or numbers). It returns True if all characters are alphanumeric and the string is not empty, and False otherwise. Spaces, symbols, and punctuations are not considered alphanumeric.


Read More about isalnum from Python Documentation

Function Signature



Module: builtins

Class: str

Parameters



Return


Returns a boolean indicating whether all characters in the string are alphanumeric.


Return Type


bool

Output

Explanation

This example demonstrates the basic usage of isalnum(). It returns True because all characters are either letters or numbers.