String Methods
isalnum()
Check whether every character is a letter or a number.
str.isalnum()
Check whether every character is a letter or a number.
Result
Returns
True when the string is non-empty and all characters are alphanumeric; otherwise False.
Run it
Try it
Run it and change it
text = "Code123" print(text.isalnum())
Output
Press Run to see what it prints.