In: Computer Science
step by step in python please
Madlibs: A children's game where someone is prompted for a series of words of particular types (e.g., nouns, verbs, colors, animals, etc.) and then those words are inserted into a "story" often creating funny outcomes. Write a Madlib program that will prompt a user for the following types of words in this order:
Noun, Food, Food, Verb, Adverb, Adjective, Plural Noun, Color, Verb, Verb, Noun, Female Name, Plural Noun
Using those inputs, output the following "song" based on the beginning of The Beatle's "Lucy in the Sky with Diamonds", substituting the user inputs into the appropriate places to create the Madlib:
Picture yourself in a [NOUN1] on a river,
With [FOOD1] trees and [FOOD2] skies
Somebody calls you, you [VERB1] quite [ADVERB],
A girl with [ADJECTIVE] eyes.
Cellophane [PLURAL_NOUN1] of [COLOR] and green,
[VERB2] over your head.
[VERB3] for the girl with the [NOUN2] in her eyes,
And she's gone.
[FEMALE_NAME] in the sky with [PLURAL_NOUN2]...
[FEMALE_NAME] in the sky with [PLURAL_NOUN2]...
[FEMALE_NAME] in the sky with [PLURAL_NOUN2]...
For this assignment, clean formatting of the output will count toward your score, i.e., it should look correct with proper spacing
SOLUTION:
noun1 = input("Tell a noun : ")
food1 = input("What is your favorite food : ")
food2 = input("What is your second favorite food : ")
verb1 = input("Now, tell me a verb : ")
adverb = input("Any Adverb? : ")
adjective = input("How about an adjective? : ")
plural_noun1 = input("Tell a plural noun : ")
color = input("What is your favorite color : ")
verb2 = input("One verb please! : ")
verd3 = input("One more verb please! : ")
noun2 = input("Tell a noun again : ")
female_name = input("Tell me a girl name : ")
plural_noun2 = input("Tell an another plural noun : ")
print("\nA song for you...\n")
print("Picture yourself in a", noun1, "on a river,")
print("With", food1, "trees and", food2, "skies")
print("Somebody calls you, you", verb1, "quite", adverb,",")
print("A girl with", adjective, "eyes.")
print("Cellophane", plural_noun1, "of", color, "and green,")
print(verb1, "over your head.")
print(verd3, "for the girl with the", noun2, "in her eyes,")
print("And she's gone.")
print(female_name, "in the sky with", plural_noun2,"...")
print(female_name, "in the sky with", plural_noun2,"...")
print(female_name, "in the sky with", plural_noun2,"...")
OUTPUT: