Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

NO BREAK COMMAND AND USE WHILE LOOPS. You will create a program to count how many words in a sentence look like they are in

NO BREAK COMMAND AND USE WHILE LOOPS.

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 # Parameters: phrase; a string to count past tense words # Return: 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

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

Students also viewed these Databases questions

Question

Describe the five- question approach to using financial ratios.

Answered: 1 week ago