Question: Python Question 12 Write a function named wordLineCount with the following input and output: Input: a string parameter, inFile, that is the name of a

Python

Question 12 Write a function named wordLineCount with the following input and output: Input: a string parameter, inFile, that is the name of a file Output: return a dictionary in which each unique word in inFile is a key and the corresponding value is the number of lines on which that word occurs The file inFile contains only lower case letters and white space. For example, if the file ben.txt contains these lines tell me and i forget teach me and i remember involve me and i learn then the following would be correct output: >>> print(wordLineCount('ben.txt')) {'remember': 1, 'and': 3, 'tell': 1, 'me': 3, 'forget': 1, 'learn': 1, 'involve': 1, 'i': 3, 'teach': 1}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!