Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!