Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 characters

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

Entity Alignment Concepts Recent Advances And Novel Approaches

Authors: Xiang Zhao ,Weixin Zeng ,Jiuyang Tang

1st Edition

9819942527, 978-9819942527

More Books

Students also viewed these Databases questions

Question

Which properties are true for the GELU activation function

Answered: 1 week ago

Question

What is the relation of physical mathematics with examples?

Answered: 1 week ago

Question

What are oxidation and reduction reactions? Explain with examples

Answered: 1 week ago

Question

2. Outline the functions of nonverbal communication

Answered: 1 week ago