Word Puzzles
Will Shortz is a noted puzzlemaster for the New York Times and National Public Radio who frequently posts challenging word puzzles. Many word puzzles can be solved by iterating through a list of words while checking for characteristics specified by the puzzle. Many word lists exist on the web, and we provide one on the text’s website— any sufficiently large one will suffice. We have not covered file reading in detail yet, so here we provide a function that reads a file named wordList.txt and returns a list of words in lowercase. The file has one word per line. For each puzzle, copy this program and write your solution as the puzzle function. Note that the puzzle function has one parameter—the wordList.
# Word puzzle driver
# Assumes word_list. txt file of one word per line
def get word list(): """Return a list of words from a word_list. txt file.""" data file = open("word list. txt"," r") word list = [] # start with an empty word list for word in data file: # for every word (line) in the file # strip off end-of-line characters and make each word lowercase # then append the word to the word_list word list.append(word.strip().lower()) return word list def puzzle(word list): """Puzzle solution goes here. """ pass # filler that does nothing except put something in the suite word list = get word list() puzzle(word list)
(a) The comparative form of the adjective big is bigger, and the superlative form is biggest. All three forms (big, bigger, and biggest) are related. However, there exists a root word that is not an adjective that when “er” is appended and “est” is appended, the result is a set of three words whose meanings are unrelated. Write a puzzle function that prints out all such triples (root, root + “er”, root + “est”). Scan through your list to find a set of triples that are unrelated to each other.
(b) Find an uncapitalized, unhyphenated word that contains all but one of the letters of the alphabet from l to v (“lmnopqrstuv”).
(c) What word consists of two consecutive pronouns? This list of pronouns will be helpful.
pronouns =['thou','thee','thine','thy',' i','me', 'mine','my','we','us','ours','our','you' ,'yours', 'your','he','him','his','she','her','hers','it', 'its','they','them', ' theirs','their'](d) What six-letter word has its meaning reversed when its first letter is changed from c to h ? Print out the candidates and then select by hand.
(e) Find an uncapitalized, seven-letter word, containing just a single vowel that does not have the letter s anywhere within it.
(f) The word mimeographs contains all the letters of memphis at least once. Find other words that also contain all the letters of memphis.
(g) Find a word that contains the string “tantan.”
(h) The word marine consists of five consecutive, overlapping state postal abbreviations: Massachusetts (MA), Arkansas (AR), Rhode Island (RI), Indiana (IN), and Nebraska (NE). Find a seven-letter word that has the same property.
(i) When you are writing in script, there are four letters of the alphabet that cannot be completed in one stroke: i and j (which require dots) and t and x (which require crosses). Find a word that uses each of these letters exactly once.
(j) There are four words that contain the consecutive letters “nacl.” Find them.
(k) Find a word that contains the vowels a, e, i, o, and u in that order.
(l) Consider the word sure. If we asked you to add two pairs of doubled letters to it to make an eight-letter word, you would add p’s and s’s to make suppress. Find an eight-letter word resulting from adding two pairs of doubled letters to rate.
(m) Find three words that are spelled the same except for their first two letters, which can be sw, tw, or wh.
(n) Two U.S. state capitals have a prefix that is the name of a month. Find them.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.