Run
x = "value_1" if x.isidentifier(): print('Given string is a valid IDENTIFIER.') else: print('Given string is NOT a valid IDENTIFIER.')
Output