def isvalid_identifier(s):
 return ((s is not None) and (not iskeyword(s)) and (re.match('^[_a-zA-Z][_a-zA-Z0-9]*$', s) is not None))

def isvalid_identifier ( s ) : return ( ( s is not None ) and ( not iskeyword ( s ) ) and ( re . match ( '^[_a-zA-Z][_a-zA-Z0-9]*$' , s ) is not None ) )
check whether a string is a valid python identifier examples .