Question: Read sentences from the user until * is entered. Show the number of words in each sentence that contain a stretch of non-z characters
Read sentences from the user until * is entered. Show the number of words in each sentence that contain a stretch of non-z characters with exactly 2 vowels. A stretch starts from the start of the word or after a 'z'. A stretch terminates just before another 'z' or at the end of the word. Examples: 1. Matching words: zoo, azozooza, GONZALEZ 2. Non-matching words: ozo, azoooza The sentences contain no punctuation, the words are separated by one or more spaces, and the characters may be upper or lower case. Keep reading sentences until the user enters "*". Sample I/O: Sentence: azoooza azooza zoo azoo. Matching words = 3 Sentence: GONZALEZ passes the ball to VAZQUEZ Matching words = 3 Sentence: azozototzeti Matching words = 1 Sentence: * Done
Step by Step Solution
3.46 Rating (153 Votes )
There are 3 Steps involved in it
Solution Heres a Python program that reads sentences from the user until is entered and counts the n... View full answer
Get step-by-step solutions from verified subject matter experts
