'Write a program to find the shortest word and index that word from a word list (in Python)'
Added by Melissa J.
Step 1
We can initially set the shortest word to the first word in the list and the index to 0. Then, we iterate over the list of words. For each word, we check if its length is less than the length of the current shortest word. If it is, we update the shortest word and Show more…
Show all steps
Your feedback will help us improve your experience
Florencia Cuzmar and 56 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
I'm having trouble writing this program in python: Write a code that reads inn 3 words and prints the shortest word. If multiple words have the shortest length (equal), print all the words.
Akash M.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD