Answered step by step
Verified Expert Solution
Question
1 Approved Answer
IN PYTHON Use Python's list comprehension to make a list of all the words in a string that have more than three letters and either
IN PYTHON
Use Python's list comprehension to make a list of all the words in a string that have more than three letters and either begin with a vowel or contain any of the letters from a second string provided. Name the function "word_smith". This function will receive two strings as input and must return the count of words in the list as an integer value. The first string will be used to build your list. The second string will be the one to check for characters. Example Input strings: "Programming languages is definitely the best course I have taken in my entire undergraduate CS career!", "Don't OVERTHINK it!" List: [Programming, languages, definitely, best, course, taken, entire, undergraduate] Return: 8 Notes on vowel: Normal vowels including y. The case does not matter, Aa Notes on the input strings: Case matters. E =-e Spaces are not words so you can ignore them as characters. . . You should ignore any character that is not part of the English alphabet ([a-z,A-Z) in the second string. Which means, from the example, that if the first input string contains the word "whomst?!", it would be included in the count because of the 'o' and 't', however, "play!" would not be included. Non-alphabet characters do not count towards the character count. Ee! is two charactersStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
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