Python Help I Will give thumbs up for a code that follows th

Python Help

I Will give thumbs up for a code that follows the instructions, compiles and has a good explanation!!! Include what your code outputs!

The story generator – the Mad-libs game asks for parts of speech, such a noun,
adjective, or adverb, and those words are plugged into a template to generate a
sometimes-funny story.
For this problem, write a function that plays a game of Mad-libs. Your function
(MadLib) will be given an integer parameter to select the story from a list of
story templates and will return the MadLib string with words from the user
substituted for the placeholders. You program will store the templates as strings
and ask the user for appropriate parts of speech to fill in the template based on
the given parameter.

your code when executed must parse the information out of the original string. You cannot predetermine the items to be replaced, you must write code so that the computer will search for the items to be replaced and prompt the user for the replacement strings.

For example the mad lib should be stored as a single string:

madlib = \"Two <noun-plural>, both alike in dignity, In fair <place>, where we lay our scene.\"

Solution

print( \'A noun is a word (other than a pronoun) used to identify any of a class of people, places, or things common noun,\' \' or to name a particular one of these proper noun.\' ) one = input(\"Enter a plural noun: \") print() print( \'A place is a particular position or point in space\' ) two = input(\"Enter a place: \") print() print( \'A noun is a word (other than a pronoun) used to identify any of a class of people, places, or things common noun,\' \' or to name a particular one of these proper noun.\' ) three = input(\"Enter a noun: \") print() print( \'A noun is a word (other than a pronoun) used to identify any of a class of people, places, or things common noun,\' \' or to name a particular one of these proper noun.\' ) four = input(\"Enter a plural noun: \") print() print( \'A noun is a word (other than a pronoun) used to identify any of a class of people, places, or things common noun,\' \' or to name a particular one of these proper noun.\' ) five = input(\"Enter a noun: \") print() print( \'An adjective is a word or phrase naming an attribute, added to or grammatically related to a noun to modify or \' \'describe it.\' ) six = input(\"Enter an adjective: \") print() print( \'A verb is a word used to describe an action, state, or occurrence, and forming the main part of the predicate of a\' \' sentence, such as hear, become, happen.\' ) seven = input(\"Enter a verb: \") print() eight = input(\"Enter a number: \") print() print( \'An adjective is a word or phrase naming an attribute, added to or grammatically related to a noun to modify or \' \'describe it.\' ) nine = input(\"Enter an adjective: \") print() print(\"A body part is... a part of your body\") ten = input(\"Enter a body part: \") print() print( \'A verb is a word used to describe an action, state, or occurrence, and forming the main part of the predicate of a\' \' sentence, such as hear, become, happen.\' ) eleven = input(\"Enter a verb: \") print() print() print(\'\'\' Two {one}, both alike in dignity, In fair {two}, where we lay our scene, From ancient {three} break to new mutiny, Where civil blood makes civil hands unclean. From forth the fatal loins of these two foes A pair of star-cross’d {four} take their life; Whole misadventured piteous overthrows Do with their {five} bury their parents’ strife. The fearful passage of their {six} love, And the continuance of their parents’ rage, Which, but their children’s end, nought could {seven}, Is now the {eight} hours’ traffic of our stage; The which if you with {nine} {ten} attend, What here shall {eleven}, our toil shall strive to mend. \'\'\'.format( one=one, two=two, three=three, four=four, five=five, six=six, seven=seven, eight=eight, nine=nine, ten=ten, eleven=eleven ))
Python Help I Will give thumbs up for a code that follows the instructions, compiles and has a good explanation!!! Include what your code outputs! The story gen

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site