Question: Please help with example problems 5 and 6. 5. Note: The characters are meant to be there. 5. select_lines_from_le In this function, we will open
Please help with example problems 5 and 6.
5.
Note: The characters are meant to be there.


5. select_lines_from_le In this function, we will open a le for reading, look at each line in the le, and return a list of the lines in the le that contain a specied query string. We do not need to change the lines in the le 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 le called nal_sample.txt: lit 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] Then a sample call should look like: l>>> select_lines_from_file("final_sample.txt"J "time\") ['it was the best of times\ ', 'it was the worst of times\ ', 'time Mil \f
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
