Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Checkpoint 3: Putting it all together Now, we are going to put these together. Copy your code from the previous checkpoint to a file
Checkpoint 3: Putting it all together Now, we are going to put these together. Copy your code from the previous checkpoint to a file called check3.py. As in checkpoint 2, you will ask from the user a starting point: file number, paragraph number and the line number. You will first find the first line of the program. Then, you will construct the program using a WHILE loop, until you reach the line END/0/0/0. Write the lines you found in a file called program.py. When done, load the recovered program into Spyder and execute it. Try the following starting points: 1/5/4 4/40/2 4/42/14 Your program must report failure if your parsing fails, which would happen if you have a bug in your code for counting paragraphs and lines or an incorrect starting point is given. Tu I CL................... ANASONIZADA 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 def parse_line (line): count = 0 length_of_line len(line) for req_index in range (length_of_line-1, 0, -1): if line[req_index] == '/'; count + 1 if count == 3: break if count
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