Question: My code isn't printing correctly 1 HWite a function called search _ in _ files. search _ in _ files 2 Hshould have two parameters:
My code isn't printing correctly HWite a function called searchinfiles. searchinfiles Hshould have two parameters: a filenare and a string to search for. #searchinfiles should return a list of line numbers as integers twhere the string appeared. Note that the string at that index does #not rieed to BE the search string, but rather must just contain it#You should assume that the first line in a file is line not line e#for example, if the files contents was: itcat Acats #dog #ddogs #catsup if "Then searchinfiles inputfile.txt "cat" would return in because "cat" appears on ines and #Add your code herel wThe code below will test your function. You can find the file it Ereferences in the dropdown in the top left. If your code works, Hthis should print:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
