Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. Implement the function matches () that takes in two numbers as a parameter. The function will ask the user to enter n words

imageimage

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 [ ]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Elements Of Chemical Reaction Engineering

Authors: H. Fogler

6th Edition

013548622X, 978-0135486221

More Books

Students also viewed these Algorithms questions