4. Implement the function matches () that takes in two numbers as a parameter. The function...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
4. Implement the function matches () that takes in two numbers as a parameter. The function will ask the user to enter n words of 1 length. The function will collect all the worders than are greater than 1 length and return a list of them. The function will tell the user if the word was accepted or not as the user enters them. See screenshot below for details. >>|words=matches (5,5) Please enter a word: zero The length of zero is 4 we will not accept it. Please enter a word: catcher The length of catcher is 7 we will accept it. Please enter a word: trial The length of trial is 5 we will not accept it. Please enter a word: seperate The length of seperate is 8 we will accept it. Please enter a word: interesting The length of interesting is 11 we will accept it. >>> words ['catcher', 'seperate', ' 'interesting'] >>> words=matches (2,1) Please enter a word: cat The length of cat is 3 we will accept it. Please enter a word: dog The length of dog is 3 we will accept it. >>> words ['cat', 'dog'] >>> words=matches (2,10) Please enter a word: a The length of a is 1 we will not accept it. Please enter a word: b The length of b is 1 we will not accept it. >>> words [ ] 4. Implement the function matches () that takes in two numbers as a parameter. The function will ask the user to enter n words of 1 length. The function will collect all the worders than are greater than 1 length and return a list of them. The function will tell the user if the word was accepted or not as the user enters them. See screenshot below for details. >>|words=matches (5,5) Please enter a word: zero The length of zero is 4 we will not accept it. Please enter a word: catcher The length of catcher is 7 we will accept it. Please enter a word: trial The length of trial is 5 we will not accept it. Please enter a word: seperate The length of seperate is 8 we will accept it. Please enter a word: interesting The length of interesting is 11 we will accept it. >>> words ['catcher', 'seperate', ' 'interesting'] >>> words=matches (2,1) Please enter a word: cat The length of cat is 3 we will accept it. Please enter a word: dog The length of dog is 3 we will accept it. >>> words ['cat', 'dog'] >>> words=matches (2,10) Please enter a word: a The length of a is 1 we will not accept it. Please enter a word: b The length of b is 1 we will not accept it. >>> words [ ]
Expert Answer:
Related Book For
Posted Date:
Students also viewed these algorithms questions
-
Mark's company is involved in a civil case. What evidentiary standard is he likely to need to meet?
-
Python and most Python libraries are free to download or use, though many users use Python through a paid service. Paid services help IT organizations manage the risks associated with the use of...
-
(b) (i) A long single mode optical fiber has an attenuation of 0.40 dBkm when operating at a wavelength of 1.55 m. The fiber core diameter is 6 pm and the laser source bandwidth is 500 MHz. Determine...
-
Using your IP address and your mask, what is your network address? This is determined by converting the IP address and the mask to binary and then proceeding with a bitwise logical AND operation. For...
-
Implement a Bird Sighting Machine class that can be used to count the number of bird sightings for a bird watch group. Include methods to clear the machine state, to record a sighting of BirdA, to...
-
List applications of I.C. engines.
-
The data that follow were drawn from the city of Boulder, Colorado's CAFR. Dates have been changed. They are from two statisticalsection schedules showing the mix of revenue and expenditures for a...
-
Ida Company produces a handcrafted musical instrument called a gamelan that is similar to a xylophone. The gamelans are sold for $913. Selected data for the company's operations last year follow:...
-
Describe the characteristics common to companies that are able to successfully innovate in highly competitive markets. List five examples of characteristics of a creative organization.
-
A person at 5.50 atm effuses through a pinhole at a rate of 5.25 mg/min. At what rate, in mg/min, would NO gas, also at 5.00 atm, effuse through the same pinhole?
-
Draw and calculate the two following gear trains. a.) Constraints: Input gear = 16 teeth; no two gears connected together can have a ratio of more than 6:1 ; Input gear = 10 rad/sec Make a simple...
-
Apple uses overseas workers for several reasons, including cost and tolerance of working conditions that would not be acceptable in the US. But if a society/culture, such as China, readily accepts...
-
What strategies do enterprises deploy to navigate the intricate terrain of anti-corruption compliance, integrating robust internal controls, due diligence protocols, and transparency mechanisms to...
-
Hechinger Co. and Home Depot are two home improvement retailers. Compared to Hechinger, founded in 1900s, Home Depot is a relative newcomer. But in recent years, while Home Depot was reporting large...
-
Investment X offers to pay you $5,200 per year for eight years, whereas Investment Y offers to pay you $7,300 per year for five years. 1. Calculate the present value for Investment X and Y if the...
-
Determine two different Hamilton circuits in each of the following graphs. A B F G
-
An analysis by Professor Peter M Rothwell and his colleagues (Nuffield Department of Clinical Neuroscience, University of Oxford, UK) published in 2012 in the medical journal The Lancet...
-
The following table shows the result of the 2018 General Elections in Pakistan, along with the vote share predicted by several organizations in the days before the elections. The sample sizes were...
-
The Chinese Academy of Sciences and the Chinese Academy of Environmental Planning conducted a survey of about 563 Chinese, with a tertiary education, about their interest in reducing global warming....
Study smarter with the SolutionInn App