Category: Preeti Arora Solution

Write a program to read a file ‘Story.txt’ and create another file, storing an index of Story.txt, telling which line of the file each word appears in. If word appears more than once, then index should show all the line numbers containing the word.

Here’s a Python program that reads a file called ‘Story.txt’, creates another file called ‘Index.txt’, and stores an index of the words in ‘Story.txt’, indicating the line numbers where each…