Question: Find shortest and longest of n words Write a Python program that allows the user to enter an arbitrary number of words, one at a
Find shortest and longest of n words
Write a Python program that allows the user to enter an arbitrary number of words, one at a time, and then prints the shortest and longest of all words entered. The program should stop inputting values and proceed to display the results when the user enters the word 'stop'.
Sample runs: inputs in bold
Run your program twice to produce the following output:
Enter word: much
Enter next word: ado
Enter next word: about
Enter next word: nothing
Enter next word: stop
The shortest word was ado
Then longest word was nothing
Enter word: OOP
Enter next word: stop
The shortest word was OOP
Then longest word was OOP
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
