Answered step by step
Verified Expert Solution
Link Copied!

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

image

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 ... 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

A Survey of Mathematics with Applications

Authors: Allen R. Angel, Christine D. Abbott, Dennis Runde

10th edition

134112105, 134112342, 9780134112343, 9780134112268, 134112261, 978-0134112107

More Books

Students also viewed these Programming questions

Question

A general journal is often called a book of original entry. Why?

Answered: 1 week ago

Question

Express the number in scientific notation. 0.000034

Answered: 1 week ago