Will shortz is a noted puzzlemaster for the new york times


PLEASE USE PYTHON SPYDER

Part A: Word Puzzle #1

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 online and we provide one with about 250,000 words, one word per line, named dictionary.txt.

Find an uncapitalized, seven-letter word, that doesn't have an "s" anywhere in it and contains just a single vowel. In this case include "y" as a vowel so your vowels are a, e, i, o, u and y, How to solve this?

Beginning programmers often overlook the easiest approach which is called "brute force." In this case, that means to read through the file of words one word at a time (remember there is one word per line) and check each one to see if it meets the requirements of the puzzle. When you find one that fits, print it.

I found that checking all the requirements to be easy except for "contains just a single vowel." I found it useful to have a Boolean I named has_one_vowel which I set to be False before I checked a word. I found that it helped me keep track of whether I had already found a vowel. (I found 3 words that fit in this word list.) Hint: use for to iterate through the file.

Part B: Word Puzzle #2

Find a word that contains the vowels a, e, i, o and u, one each, in that order. Again use the dictionary.txt word file and brute force.

You may find the continue statement to be useful: if the word doesn't match one of the requirements, use continue to jump to the next word in the file (that is, go to the beginning of your loop). (I found 16 words that fit in this word list.)

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Will shortz is a noted puzzlemaster for the new york times
Reference No:- TGS02894491

Expected delivery within 24 Hours