Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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