Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 11 Part A(10 points) The three words 'a', 'an' and 'the' are the only articles in the English language. Write a function named countArticles().

Problem 11 Part A(10 points) The three words 'a', 'an' and 'the' are the only articles in the English language. Write a function named

countArticles(). Hint: Count both capitalized and lower case instances of articles.

Input: a list of strings, each string being a single word. (You may assume that the input is valid.) Return: the number of articles in the list.

For example, the following would be correct output: >>> theFlea = ['The','flea','is','a','mighty','insect'] >>> print(articleCount(theFlea)) >>> 2

Part B (10 points) Write a function named shortWordCount(). (Hint: use the split method.)

Input: a string. (You may assume that the string contains only letters and spaces -- no punctuation.)

Return: the number of words in the string with 3 or fewer letters. For example, the following would be correct output: >>> theFlea = 'The flea is a mighty insect'

>>> print(shortWordCount(theFlea))

>>> 3

solve by using phyton

this is cs class 104

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

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago