Answered step by step
Verified Expert Solution
Link Copied!

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 1 HWite a function called search_in_files. search_in_files 2 Hshould have two parameters: a filenare and a string to search for. 3\#search_in_files should return a list of line numbers as integers 4 twhere the string appeared. Note that the string at that index does 5\#not rieed to BE the search string, but rather must just contain it.6\#You should assume that the first line in a file is line 1, not line \(7=1\)e.\(8=\)9\#for example, if the files contents was: 18 itcat 12 Acats 12\#dog 13\#ddogs 14\#catsup 15 if 16 "Then search_in_files ("input_file.txt" "cat") would return 17 in \([1,2,5]\), because "cat" appears on 1ines 1,2, and 5.23\#Add your code herel 42 wThe code below will test your function. You can find the file it 43 Ereferences in the drop-down in the top left. If your code works, 44 Hthis should print:

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

3rd Edition

0071107010, 978-0071107013

More Books

Students also viewed these Databases questions

Question

c. What groups were least represented? Why do you think this is so?

Answered: 1 week ago

Question

7. Describe phases of multicultural identity development.

Answered: 1 week ago