4. Implement the function matches () that takes in two numbers as a parameter. The function will ask the user to enter n 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 [ ]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started