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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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