Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python 3.6 Question 13a (10 points) The letters a, e, i. o and u are vowels. No other letter is a vowel. Write a function

Python 3.6

image text in transcribed

Question 13a (10 points) The letters a, e, i. o and u are vowels. No other letter is a vowel. Write a function named vowelCount) that takes a string. s, as a parameter and returns the number of vowels that s contains. The string s may contain both upper and lower case characters. For example, the function call vowelCount('Amendment) should return the integer 3 because there are 3 occurrences of the letters 'A' and 'e' Question 13b (10 points) Write a function named manyVowels() that takes a body of text, t, and an integer, i, as parameters. The text t contains only lower case letters and white space. manyVowels() should return a dictionary in which the keys are all words in t that contain at least i vowels. The value corresponding to each key is the number of vowels in it. For full credit, manyVowels() must call the helper function vowelCount) from Question lla to determine the number of vowels in each word. For example, if the input text contains the word "hello". then "hello" should be a key in the dictionary and its value should be 2 because there are 2 vowels in Input: 1. t, a text consisting of lower case letters and white space 2. i. a threshold number of vowels Return: a dictionary of key-value pairs in which the keys are the words in t containing at least i vowels and the value of each key is the number of vowels it contains. For example, the following would be correct output. text 'they are endowed by their creator with certain unalienable rights print (manyVowels(text, 3)) certain': 3, unalienable': 6, 'creator': 3. 'endowed 3)

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_2

Step: 3

blur-text-image_3

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

Database Processing Fundamentals Design

Authors: Marion Donnie Dutton Don F. Seaman

14th Edition Globel Edition

1292107634, 978-1292107639

Students also viewed these Databases questions

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago