subject

At the end of most textbooks there is usually an index that lists the pages where a certain word appears. In this problem, you will create an index for a text but, instead of the page number, you will use the line number. Implement the function index() that takes as input the name of a text file and a list of words. For every word in the list, your function will find the lines in the text file where the word occurs and print the corresponding line numbers (where the numbering starts at 1). You should open the file only once.
>>> index('raven. txt', ['raven', 'mortal', 'dying', 'ghost', 'ghastly', 'evil', 'demon'])
raven 44, 53, 55, 64, 78, 97, 104, 111, 118, 120
mortal 30
dying 9
ghost 9
ghastly 82
evil 99,106
demon 122
>>>

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:00
Write a function that draws a pool ball. this function should take as parameters, the color, the number that should go on the pool ball, and the location of the center of the pool ball. the radius of the pool balls should be pool_ball_radius, and the font of the number should be pool_ball_font. the text of the pool ball font should be white. drawpoolball(color.orange, 5, 100, 100); drawpoolball(color.green, 6, 50, 200); drawpoolball(color.red, 3, 150, 350); drawpoolball(color.blue, 2, 250, 140); to center the numbers on the pool ball, you should use the getwidth() and getheight() methods. you are allowed to call these methods on your text object, such as txt.
Answers: 3
question
Computers and Technology, 22.06.2019 17:00
What allows you to create a wireless connection among your smart devices
Answers: 2
question
Computers and Technology, 23.06.2019 02:30
These factors limit the ability to attach files to e-mail messages. location of sender recipient's ability to open file size of file type of operating system used
Answers: 2
question
Computers and Technology, 24.06.2019 15:40
In the above figure, what type of cylinder arrangement is shown in the figure above? a. l-type b. v-type c. in-line d. horizontal pls make sure its right if its rong im grounded for 3months
Answers: 1
You know the right answer?
At the end of most textbooks there is usually an index that lists the pages where a certain word app...
Questions
question
Mathematics, 09.01.2020 16:31
question
Mathematics, 09.01.2020 16:31
question
Mathematics, 09.01.2020 16:31
Questions on the website: 13722361