def select_lines_from_file(filename, query): pass

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter9: Completing The Basics
Section9.2: Exceptions And File Checking
Problem 3E
icon
Related questions
Question
### QUESTION FIVE ###
def select_lines_from_file(filename, query):
pass
Transcribed Image Text:### QUESTION FIVE ### def select_lines_from_file(filename, query): pass
5. select_lines_from_file
In this function, we will open a file for reading, look at each line in the file, and return a list of the lines in the file that
contain a specified query string. We do not need to change the lines in the file in any way, just put them in a list and
return that list. Don't worry about case
this function is case-insensitive.
If we have the following text in a file called final_sample.txt:
it was the best of times
it was the worst of times
time keeps on slippin into the future
this sentence does not contain that particular word
also this one doesn't contain it either
Transcribed Image Text:5. select_lines_from_file In this function, we will open a file for reading, look at each line in the file, and return a list of the lines in the file that contain a specified query string. We do not need to change the lines in the file in any way, just put them in a list and return that list. Don't worry about case this function is case-insensitive. If we have the following text in a file called final_sample.txt: it was the best of times it was the worst of times time keeps on slippin into the future this sentence does not contain that particular word also this one doesn't contain it either
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Table
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning