Answered step by step
Verified Expert Solution
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.
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
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