Computers and Technology
Computers and Technology, 21.11.2019 04:31, vane8229

Ou are going to create some mad libs. there are two files available: a word list full of common words ("words. txt"), and a short story ("story. txt"). process both files line-by-line in order to replace the words from the first file in the short story with the string "" (four underscores). then, print the resulting story, each line of the story on its own line.
one issue you may encounter: you cannot loop through a file again after you have read its contents once. solve this issue by storing the words file in a list before processing the story.
in python
words. txt
cat
that
phat
chat
combat
bat
fat
hat
rat
the cat in the hat came back the other day, chasing a bat and a rat.
i asked the cat in the hat why the bat and the rat were his combat.
he said, "that bat and the rat said i was fat! "
the bat and the rat groaned and turned to me.
"we said he was phat! " they said as a plea.
i calmed and spoke kindly to the cat with the hat,
"can't we make this into a nice chat? "
and that was the end of that.
story. txt

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 00:30, bargasdevon123
To insert a column without using commands in any tabs, a user can -click and then click insert column.
Answers: 3
image
Computers and Technology, 22.06.2019 19:30, andyromero
Once the data center routes to the destination server that hosts the website, what's the next step in the internet process? user’s browser renders html code from destination server into web page request goes through router/model and isp request routed to nameserver and datacenter
Answers: 2
image
Computers and Technology, 23.06.2019 22:20, tagerryawilson6
If i uninstall nba 2k 19 from my ps4 will my career be gone forever?
Answers: 2
image
Computers and Technology, 25.06.2019 10:00, kyleryoung0602
Most common level of education for a programmer or software developer
Answers: 1
Do you know the correct answer?
Ou are going to create some mad libs. there are two files available: a word list full of common wor...

Questions in other subjects:

Konu
Mathematics, 25.06.2019 00:00