def is_keyword(text):
 import keyword
 return (text in keyword.kwlist)

def is_keyword ( text ) : import keyword return ( text in keyword . kwlist )
test if passed string is the name of a python keyword .