Question: 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 0. 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 3 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 for-in loop (do not just say
print(used)). Print all the list items on a single line separated by commas, followed by a line that says, All
done., as in
Used: 0,1,2,3,
All done.
Notice that each item is followed by a comma. For 5 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

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!