Required output is "The longest word has 13 characters. The result includes: word1 word2"
I am required to use the terminal to write python '''.py < .txt''' and I am stuck after the following codes I have written and have no idea how I should use the max function for it. Need some help desparetely. It is for MapReduce
import sys
results = {}
for line in sys.stdin:
line=line.strip().split()
for word in line:
results[word] = len(word)
You could keep track of the longest words like this: