Question: I am using python and please show me the answer and maybe some explanation of it. Checkpoint 2: Parsing some files Copy your file from

 I am using python and please show me the answer and
maybe some explanation of it. Checkpoint 2: Parsing some files Copy your
file from checkpoint 1 to a new file called check2. py. We
I am using python and please show me the answer and maybe some explanation of it.

Checkpoint 2: Parsing some files Copy your file from checkpoint 1 to a new file called check2. py. We will not use the function you have just implemented in this part, but it is good to keep it around for the next checkpoint. Make sure you save the program file into the same folder as the text files given in the ZIP folder. This checkpoint is the second step to building your egg scavenger hunt code. This is prob- ably the most complex part of your lab. You will write a new function: get line (fname, parno,lineno) which takes as input a file name and two numbers. Basically, the two numbers tell you which paragraph and which line your egg scavenger hunt lies. Paragraphs are separated by any number of blank lines, containing nothing but the new line character and spaces. You must open the given file, skip all the paragraphs up to the requested one (parno), skip all the lines until the given line (Lineno), read and return the requested line. For example, suppose a file contains the follwing text: I love deadlines. I love the whooshing noise they make as they go by. I refuse to answer that question on the grounds that I don't know the ansver. If we are looking for paragraph 2 and line 3, your function should return the string grounds that. You should remove any trailing whitespace such as n, but be sure to preserve leading whitespace. Refer back to lecture 13 and the str.rstrip0 function if you are having problems with this part

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To solve this task we need to write a function getlinefname parno lineno that will read the specifie... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!