Question: 1. Write a program that takes an integer input n. Then it will input s, which is a line containing some words. If s

1. Write a program that takes an integer input n. Then it 

1. Write a program that takes an integer input n. Then it will input s, which is a line containing some words. If s contains exactly n words, then it will do the following- Print the words in separate lines and wrap all the texts with a rectangle made of asterisks (*). Make sure the right border of your rectangle is straight. Input Output 4 A cup of coffee *A *cup *of *coffee* 3 Laughter is medicine *Laughter* *is *medicine* 4 Word count mismatch. Try again! I am fine |JExplanation: n is 4 but number of words in the given line is 3.]

Step by Step Solution

3.43 Rating (166 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

In 1 Create program def wordprinter n intinput input words 5stripsplit nwords lenwords if n nword... View full answer

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 Programming Questions!