def longestword(filename):
(20 points)
Reads the file from filename in your function and returns
the longest word in the text file.
- Words are separated by whitespace characters, but do not include
the following punctuation characters (,.!?;). You can assume contractions
count as one word (i.e. "don't", "you'll", etc. are one word).
- In the case of a tie, the 1st occurrence of the longest word
is returned.
- The split and strip functions may be useful.
- Your function should open the file for reading, and close
the file before returning.
return "stub"