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
Step: 1
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