Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSC 2230 Computer Programming for Engineers. This is python jupyter notebook. write a function that takes a file name (string) and a word (string) and

CSC 2230 Computer Programming for Engineers. This is python jupyter notebook.

image text in transcribed

write a function that takes a file name (string) and a word (string) and returns True f that word is found anywhere in the file, otherwise returns False. For your reference (if you need it),here's a quick example code to print lines in a file: filename "hello.txt" file -open(filename, r" for line in file: print line Also remember the "in" operator that checks if a string is inside another. Now write your function below: In def checkIfFilecontains (filename, targetWord)

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 Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

how is polymorphism in the amelogenin used in forensics?

Answered: 1 week ago