Question
You will create a program to count how many words in a sentence look like they are in past tense, i.e. end in -ed. The
You will create a program to count how many words in a sentence look like they are in past tense, i.e. end in -ed.
The program must contain a main() and a function calledcountPastTense(), implemented as described in the function header comment given below. (You should include this function header comment in your own code.)
############################################################# # countPastTense() counts past tense words # Input: phrase; a string to count past tense words # Output: none
Here is some sample output, with the user input in blue. (Yours does not have to match this word for word, but it should be similar.)
linux[0]$ python hw5_part2.py Tell me something: This show has jumped the baby sharkThere appear to be 1 past tense words in that.
linux[0]$ python hw5_part2.py Tell me something: All those red hermit crabs attacked me when I fed them There appear to be 3 past tense words in that.
linux[0]$ python hw5_part2.py Tell me something: Periods make the word be ignored. There appear to be 0 past tense words in that.
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