Find a word that contains the vowels

Assignment Help Computer Engineering
Reference no: EM132101035

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.)

Reference no: EM132101035

Questions Cloud

Business consists of preparation and delivery of hot meal : Family Meals, Inc. is a thriving business in a large metropolitan area of over 500,000 people. The business consists of the preparation and delivery of hot meal
Create a primary function that returns the number of trials : Create a primary function that returns the number of trials that give each of the distinct simulated sums of two dice rolls.
Represents jason status in regards : Which of the following likely represents Jason's status in regards to his employment with Nick?
Examples of marketing activities : Problem: What are some examples of "marketing" activities that are associated with the Summer Olympics?
Find a word that contains the vowels : Will Shortz is a noted puzzlemaster for the New York Times and National Public Radio who frequently posts challenging word puzzles.
What is the power output of the charge escalator : A 1.5 V battery provides 0.50 A of current. At what rate (C/s) is charge lifted by the chargeescalator? What is the power output of the charge escalator?
Northeastern state was intrigued by idea of using drones : Sheriff Alonzo Griffith of Metropolitan County Government in a northeastern state was intrigued by the idea of using drones,
Legislation impact on operations : How could legislation impact on operations within your organisation in relation to innovation, project management
Difference between objective and subjective impossibility : Explain the difference between objective and subjective impossibility.

Reviews

Write a Review

Computer Engineering Questions & Answers

  What is advantage of payroll scheme approach for the project

What is advantage of payroll scheme approach for the project? What do you think is the most suitable Life Cycle Approach?

  What is the cell reuse distance

What is the cell reuse distance for a 15 km cell radius with a k=6?

  Identity and access management for electric utilities

SP 1800-11 Essay topic assignment: Read and summarize the following NIST SP 1800s. A paragraph on each assigned guide.

  Perform a monte carlo simulation

Perform a Monte Carlo simulation when the binary signaling is on-off-keying (OOK) and the channel is a slowly fading frequency nonselective Rayleigh channel.

  Write down an automated checkout program

Write down an automated checkout program

  Show the sine of any angle typed on the keyboard

design a randome file of the sines of all angles from 0 degrees to 90 degrees. Make each entry accurate to three places. Write a program that will display the sine of any angle typed on the keyboard.

  Modify infix-to-postfix algorithm that it can handle errors

Modify the infix-to-postfix algorithm so that it can handle errors. Modify the postfix evaluation algorithm so that it can handle errors.

  Protecting the operating systems

Explain the relative benefit and de-merits of at least three different measures that are used in order to protect the operating systems.

  Define primary way in society use psychological theories

discuss the primary way in which society or an individual could use the psychological theories

  They want ot add calculation of shipping and tax

Each step takes 7 days except mail, that is the next day after personalize.

  Creating database for company

If you were preparing to create a brand new database for a company, do you think there would be any value in the interviewing the users to determine out what colors and designs they like?

  What are the benefits of software engineering

What is the appropriate justification for an employee that can be submitted to his/her business line to persuade to accept the study of software engineering.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd