Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python 3.6 Question 13a (6 points) Write a function named countVowels that takes one parameter: s, a string that may contain both upper and lower

Python 3.6

image text in transcribed

Question 13a (6 points) Write a function named 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 vowelFrequency that takes one parameter: t, a string The function vowelFrequency 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 vowelFrequency 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'], 3: forgotten' 13

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

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions