Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 13a (6 Write a function named countVowels that takes one parameter: rsse on unet fo poaned countvowels that takes one parameter: s, a string

image text in transcribed
Question 13a (6 Write a function named countVowels that takes one parameter: rsse on unet fo poaned countvowels that takes one parameter: s, a string that may contain both upper and lower case characters The function countVowels should return the number of vowels in s. The vowels are the letters 'a', 'e', i, 'o, and 'u' For example, the function call countVowels( 'Amen') should return 2. Question 13b (14 points) Write a function named vowe1Frequency that takes one parameter: t, a string The function vowe1Frequency should return a dictionary in which each key is the vowel count for some word in t. The value corresponding to each key is a list of all words having that number of vowels. A word should appear at most once in a given list. Upper and lower case letters are considered the same letter ('Yes' is the same as 'yes'.) The function vowe1Frequency should call the function countVowels for each word in t to find how many vowels it has For example, the following is a correct input/output pair >>> text"Where hunger is ugly where souls are forgotten" >>> print (vowelFrequency (text)) (1: ['is', 'ugly'], 2: ['where', 'hunger, 'souls'are'1, 3: I'forgotten'])

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

Next Generation Databases NoSQLand Big Data

Authors: Guy Harrison

1st Edition

1484213300, 978-1484213308

More Books

Students also viewed these Databases questions