subject

Python 3 madlibs read file--slice string--take inputtext input included at very bottomno third party ! the goal of this assignment is to create a version of game mad libs. given a text file with the story, the program will ask the user to fill in the blanks. the program will then show the user the final story. as part of this project, you will be required write your own story. word template gamesmad libs are a type of word template game. a story is written with multiple blank spaces. the game has two players. one player asks the other for words to fill in the blanks. the player suggesting words does not know what the story is or what the words are for. once all the blanks have been filled in, the story is read. since the person suggesting the words does not know the context, this will lead to a funny but nonsensical story. an example of a real mad lib game is provided at the end of the instructions. the text files we are using are based on example 1 and example 2.programming projectyou will develop a python program that reads from a text file and fills in the blanks for a story. the first thing the program needs to do it ask for the text file containing the story. the program will then read the file. while the file is being read, the program will encounter words that start with a square bracket [. a word that starts with a square bracket is a blank. it needs to be filled in by the user. between the [ and ] in the string is what type of word to ask the user for. for example, if the program encounters [verb-ending-in-ing] then it should ask " give a verb ending in ing". the input from the user is then read to fill in the blank. once the entire store is complete, it will be printed out for the user. the following additional guidelines must be followed: only print the story once all blanks have been filled in. if the type of word being asked for starts with a vowel ask " give an …"if the type of word being asked for does not start with a vowel as " give a …"users may give multiple word answers. your program should not crash if the file cannot be read. it should exit gracefully. the blank space may have punctuation, be sure this is correctly printed in the story. your program must work with the three example files provided. text file 1: a vacation is when you take a trip to some [adjective] place with your [adjective] family. usually you go to some place that is near a/an [noun] or up on a/an [noun]. a good vacation place is one where you can ride [plural-noun] or play [game] or go hunting for [plural-noun]. i like to spend my time [verb-ending-in-ing] or [verb-ending-in-ing]. when parent go on a vacation, they spend their time eating three [plural-noun] a day, and fathers play golf, and mothers sit around [verb-ending-in-ing]. last summer, my little brother fell in a/an [noun] and got poison [plant] all over his [part-of-the-body]. my family is going to go to (the) [place], and i will practice [verb-ending-in-ing]. parents need vacations more than kids because parents are always very [adjective] and because they have to work [number] hours every day all year making enough [plural-noun] to pay for the vacation. text file 2: weather plays an important part in our [noun] everyday. what is weather you ask? according to [adjective] scientists, who are known as meteorologists, weather is what the [noun] is like at any time of the [noun]. it doesn't matter if the air is [adjective] or [adjective], it's all weather. when vapors in [adjective] clouds condense, we have [noun] and snow. a lot of [noun] means a [adjective] snowstorm! text file 3: [name] is having a party! it's going to be at [place] on [day-of-the-week]. make sure to show up at [time], or else you will be required to [verb] a/an [animal] with your [body-part].

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 17:20, ooooooo828282828
When developing a stakeholder matrix, the portfolio manager must look at the portfolio governance in order to complete the stakeholder analysis. in your own words, what is the role, interest and expectations of the governance?
Answers: 3
image
Computers and Technology, 22.06.2019 02:30, lauriepdx
The cm is responsible for overseeing the actions of the crisis management team and coordinating all crisis management efforts in cooperation with disaster recovery and/or business continuity planning, on an as-needed basis
Answers: 1
image
Computers and Technology, 22.06.2019 08:30, electrofy456
Active listen eliminates barries to communication true or false
Answers: 1
image
Computers and Technology, 22.06.2019 15:30, 1232444553
Which of the following examples has four beats in each measure?
Answers: 2
You know the right answer?
Python 3 madlibs read file--slice string--take inputtext input included at very bottomno third party...

Questions in other subjects:

Konu
English, 26.09.2021 23:10
Konu
Mathematics, 26.09.2021 23:10
Konu
Mathematics, 26.09.2021 23:10