Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

consonantCount (s2) Write the function consonantCount that counts how many times a consonant (either lowercase or uppercase) occurs in a string. It takes a string

consonantCount (s2) Write the function consonantCount that counts how many times a consonant (either lowercase or uppercase) occurs in a string. It takes a string s as input and returns an integer, the number of consonants in the string. For this question, y and Y are not consonants. Please use a for loop to do the computation. Please do not use a brute force solution (comparing against one consonant at a time): it will not receive credit.

Sample Input Sample Output

s2 = abra cadabra 6

s2 = how many consonants? 11

s2 = This is Hw4, folks 10

Python Answers Only! DO NOT USE A BRUTE FORCE SOLUTION.

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

Principles Of Multimedia Database Systems

Authors: V.S. Subrahmanian

1st Edition

1558604669, 978-1558604667

More Books

Students also viewed these Databases questions

Question

2. Which animal species would have the longest axonspg78

Answered: 1 week ago

Question

6. Identify the belly of the whale in Raiders of the Lost Ark.

Answered: 1 week ago

Question

List the advantages and disadvantages of the pay programs. page 505

Answered: 1 week ago