Question: Please write a code in Python that satisfies the following: Thank you!!!! Write a program that asks the user for a list of nouns (separated

Please write a code in Python that satisfies the following:
Thank you!!!!
 Please write a code in Python that satisfies the following: Thank

Write a program that asks the user for a list of nouns (separated by spaces) and approximates the fraction that are plural by counting the fraction that end in "s". Your program should output the total number of words and the fraction that end in "s". You December assume that words are separated by spaces (and ignore the possibility of tabs and punctuation between words.) A sample run of the program Enter nouns: apple bananas cantalopes durian Number of words: 4 Fraction of your list that is plural is 0.5 And another sample run of the program Enter nouns: hats gloves coats glasses scarves Number of words: 5 Fraction of your list that is plural is 1.0 Hint: Break this problem into pieces 1. First, count the number of words in the string the user entered (hint: count the number of spaces). Print out the number of words. Make sure this works before going onto the next part 2. Next, ignoring the last word (which is a special case and can be dealt with separately) count the number of words ending in 's' (hint: count the number of "s "). Test that this part works before going on to the next step 3. Last, check the last word to see if it ends in "s"- since it's the last word, the "s" will always occur at the same index in the string Implement (and test!) each part and then go on to the next. See notes from Lecture 3

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!