Program for length of the longest word in a sentence | Python program to find the number of characters in the longest word in the sentence . ; Driver Code
def longestWordLength ( string ) : NEW_LINE INDENT length = 0 NEW_LINE for word in string . split ( ) : NEW_LINE INDENT if ( len ( word ) > length ) : NEW_LINE INDENT length = len ( word ) NEW_LINE DEDENT DEDENT return length NEW_LINE DEDENT string = " I ▁ am ▁ an ▁ intern ▁ at ▁ geeksforgeeks " NEW_LINE print ( longestWordLength ( string ) ) NEW_LINE