Python String isidentifier() Method
Returns True if the string is considered to be an identifier. An identifier can only contain the lowercase letters a-z, A-Z, digits 0-9, and underscores.
Syntax
Python
Copy Code
string.isidentifier()
Example
Python
Copy Code
print('abc9_42'.isidentifier()) print('ABC9_42'.isidentifier()) print('abc9_42,43'.isidentifier())
Output
True True False