Check if the character is a letter and index of character array doesn 't  equal to end of line that means, it is  a word and set isWord by true
if ( ch [ i ] . isalpha ( ) and i != endOfLine ) : NEW_LINE INDENT isWord = True NEW_LINE DEDENT