Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program that takes items from three different lists and uses them to create sentences. Define three lists named nouns, verbs, and adjectives. The
Write a program that takes items from three different lists and uses them to create sentences.
Define three lists named nouns, verbs, and adjectives. The lists contain, respectively:
"dog", "bird", "rock", "spaceship", "candidate", "waterfall"
"ran", "fell", "flew", "sat", "breathed", "tumbled"
"quickly", "slowly", "carefully", "quietly", "peacefully", "regretfully"
Use a while loop to count through the indexes starting at Use the length of the nouns list to determine
when to stop counting through the indices.
For each index select each list value for that index to build and print a sentence. For example, when the index
is you will build the sentence
The spaceship sat quietly.
After you print the sentence, append the index value to a list named used.
After all the sentences are printed, display the used list item by item, using a forin loop do not just say
printused Print all the list items on a single line separated by commas, followed by a line that says, All
done. as in
Used:
All done.
Notice that each item is followed by a comma. For extra credit points, print the list so that there is no
comma after the last item. In either case, be sure that All done is on the next line.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started