Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Pls use python coding methods to answer the best you can. Also I don't have access to mentioned files. Thanks Function Name: findWord Parameters: filename
Pls use python coding methods to answer the best you can. Also I don't have access to mentioned files. Thanks
Function Name: findWord Parameters: filename - the name of the file to look for words in word - the word to to look for Return Value: None Description: Since spring is approaching, now is a great time to check for some spring-related words in text files. Print the number of lines the word appears in in the given file, and what lines it appears in. When you're printing line numbers, use line numbers as a human would read them (i.e. the first line is line 1). You should find the word regardless of case (your code should find any capitalization of the word). Include it if the word is seen in another word, e.g. spring appears in springs and offspring. Hint: What operator allows you to see if a string is IN another string? Test Cases: >>> findWord ("Chapter01.txt", "flower") flower found on line 13 in file Chapter01.txt flower found on line 14 in file Chapter01.txt flower found on line 16 in file Chapter01.txt flower found on line 21 in file Chapter01.txt flower found on line 25 in file Chapter01.txt flower found on line 26 in file Chapter01. 1.txt flower found on line 27 in file Chapter01.txt flower found on line 28 in file Chapter01.txt flower found on line 29 in file Chapter01.txt flower found on line 41 in file Chapter01.txt flower found on line 42 in file Chapter01.txt flower found on line 43 in file Chapter01.txt flower found on line 49 in file Chapter01.txt flower was found on 13 lines. >>> findWord ("Full_Novel.txt", "spring") spring found on line 109 in file Full Novel.txt spring found on line 155 in file Full Novel.txt spring found on line 259 in file Full Novel.txt spring found on line 790 in file Full Novel.txt spring found on line 1944 in file Ful_Novel.txt spring found on line 2388 in file Full_Novel.txt spring found on line 5251 in file Full Novel.txt spring was found on 7 linesStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started