Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 2 (50 points): Given a string, write a function that counts the vowels of the English alphabet (a, e, i, o, u) and
Question 2 (50 points): Given a string, write a function that counts the vowels of the English alphabet (a, e, i, o, u) and returns the result as a dictionary. For example, astr="Lorem ipsum ..." result = count vowels (astr) print (result) is required to print something like: (number of counts are dummy in the following) {'a':10, 'e': 15, 1:10, 0:20, 'u' :15) Note: Don't forget to count vowels in capital letters. Let's say you have defined a string named astr def countvowels (x): # Write your code here pass # Delete this line if you copy this to your workfile. print (count vowels (astr)) prints, ('a':10, 'e': 15, 'i':10, 'o' :20, 'u':15)
Step by Step Solution
★★★★★
3.41 Rating (157 Votes )
There are 3 Steps involved in it
Step: 1
python def countvowelsx vowels a e i ...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