The story generator solution

$25.00

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (1 vote)

Objective:
1. Design and create code in python using control structures (branching and
looping) and user input.
For this assignment, you need to submit your program to moodle code runner. Please
include comments in your code that explain what your code is doing.
In the game Mad-libs, players are asked 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 program that plays a game of Mad-libs. Your program needs to
store a list of story templates, when the user selects a number between 1 -5 select that
template, and ask the user for parts of speech to fill in the template.
When the program starts, you should first ask the user if they want to play a game.
Your question should look like:
“Do you want to play a game? (y) or (n)”
The user types y if they want to play and n if they don’t. If the user answers y, then your
program should ask the user to enter the template number:
“Please select a template between 1 and 5:”
Let’s assume the user enters 2, you need to ask the entries for each of the missing word
type in the template 2, such as:
“Enter a noun:\n”
“Enter an adjective:\n”
“Enter another noun:\n”
“Enter another adjective:\n”
Note: Template 2 looks like this
“It was the