Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Find middle of File using PYTHON : This is the prompt and my code for the first part, i only need help writing the MIDDLE,

Find middle of File using PYTHON: This is the prompt and my code for the first part, i only need help writing the MIDDLE, MIDDLE FLAG with input options, and IF statement (less than 2 times number of lines to skip output entire file)

Write a complete PYTHON program with prompts for the user to get the main text file (checks that it exists, and if not, output an error message and stop), for any possible flags (flags allows the user to change the default conditions or to use the defaults, and for any other input that this program may need from the user: split has an option of naming the smaller files. Your program will open the input file once only and using seek(0) to avoid re-opening the file will cost all points

MY CODE FOR OPENING AND ERROR CHECK:

image text in transcribed

----------------REQUIREMENTS FOR MIDDLE "function": ----------------------

image text in transcribed

middlelist the middle lines of the file by skipping the first 5 lines (default) and skipping the last 5 lines (default) in order of the given text file flag: Comment If the file has less than 2 times the number of lines to skip, output the entire file. change the number of lines to skip at the top and bottom

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Online Market Research Cost Effective Searching Of The Internet And Online Databases

Authors: John F. Lescher

1st Edition

0201489295, 978-0201489293

More Books

Students also viewed these Databases questions