Create a program that reads words.txt (link near top of our home page) in order to: determine the length of the longest word(s)
and output that length plus the first word of this length found. determine the length of the shortest word(s) and output that length plus the first word of this length found determine and output the average length of all the words in the list.
with open("words.txt") as words: for line in words.readlines(): for word in line.split(): if len(word) > len(longest[0]): longest = [word] elif len(word) == len(longest[0]): longest.append(word) elif shortest is None or len(word) < len(shortest[0]): shortest = [word] elif len(word) == len(shortest[0]): shortest.append(word)
def format_printable(words): return ["{}: {}".format(len(word), word) for word in words]
We use comments in our documents to track issues for follow
up or make suggestions to other people. A comment is inserted inside a balloon or
a box that appears in the document's margins. Whatever the situation you may be in,
you can easily add comments in a word document.