1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Savatey [412]
3 years ago
7

Write a Python function called readlinesmton that accepts the name of the file (i.e. filename), starting line number (i.e. m) an

d ending line number (i.e. n) as a parameter. The function then returns the contents from line number m to n (m < n). If m < 1 then start from line 1. Similarly, if n > number of lines the file, then stop at the last line in the file.
Computers and Technology
1 answer:
KatRina [158]3 years ago
5 0

Answer:

Following are the code to the given question:

def readlinesmton(filename, m ,n):#defining a method that holds three parameters

   f=open(filename, 'r')#defining f variable that holds open method

   l=f.readlines()#defining a variable l that readers input file

   e=len(l)#defining e variable lengths of the file  

   s=m#defining s variable that holds parameter value

   if(m<1):#Using if block that checks m is less than 1

       s=1#use s variable that holds a value that is 1

   if(n < e):#defining n variable that checks n less than e

       e=n #using e that holds n value

   for i in range(s-1, e, 1):#defining for loop that calculates lines  

       print(l[i])#prints lines

readlinesmton("input.txt", -1, 70)#Calling a method

Output:

Please find the ouput in the attached file.

Explanation:

In this code, a method "readlinesmton" is declared that takes three-parameter and inside the method, it uses the open method to open the file, read method to read the file, and len to calculate the length of the file and use the conditional statement to check the file inputs and use the loop to prints its values.    

You might be interested in
Select the correct answer.
Sladkaya [172]

Answer:

B

Explanation:

hes not presenting, word processing or making spreadsheets and multimedia software can be used to make music

5 0
3 years ago
Read 2 more answers
6, Answer the following questions.0<br>a What is software?​
nekit [7.7K]

Answer:

Software is a set of instructions, data or programs used to operate computers and execute specific tasks. Opposite of hardware, which describes the physical aspects of a computer, software is a generic term used to refer to applications, scripts and programs that run on a device. Software can be thought of as the variable part of a computer, and hardware the invariable part.

Software is often divided into categories. Application software refers to user-downloaded programs that fulfill a want or need. Examples of applications include office suites, database programs, web browsers, word processors, software development tools, image editors and communication platforms.

Explanation:

Software is a set of instructions, data or programs used to operate computers and execute specific tasks. Opposite of hardware, which describes the physical aspects of a computer, software is a generic term used to refer to applications, scripts and programs that run on a device. Software can be thought of as the variable part of a computer, and hardware the invariable part.

Software is often divided into categories. Application software refers to user-downloaded programs that fulfill a want or need. Examples of applications include office suites, database programs, web browsers, word processors, software development tools, image editors and communication platforms.

5 0
3 years ago
A(n) ____ consists of a series of related instructions, organized for a common purpose, that tells the computer what tasks to pe
yarga [219]

Answer:

The correct answer is "Program".  

Explanation:

Program is the collection of statement or instruction which is developed for creating any software or any purpose. The program is implemented or executed by a computer to perform a particular task.The particular programmer always writes an instruction to develop a program.

Program are always organized for the common purpose, that specifies the computer what tasks to perform as well as how to perform that particular task for example if programmer develops a program of calculator then it should be only used for the calculation purpose.

7 0
3 years ago
A media strategy that involves high ________ most likely involve creating broad exposure using many media vehicles, while a stra
Tom [10]

Answer: Reach and frequency

Explanation:

 The media strategy is the planning and action that basically involve high reach in the exposure by using the media vehicle. It basically improve the overall conversation rate of customers.

The conversation rate is refers to the total percentage of the users which involve using the website and various applications.

This strategy also involve with high frequency that limited the list of the media vehicle.

 

5 0
3 years ago
You receive an email from someone who claims to be a representative from your credit card company. the email asks you to clink o
larisa86 [58]
You should call the company that your credit card is in and ask if you were sent an email. tell the time it was sent. the date. everything.
8 0
3 years ago
Other questions:
  • What is the term for the conversion of a bitmap image to a vector image?
    8·1 answer
  • How is it possible to find encyclopedias and reference texts on the internet
    11·2 answers
  • Which is true about POP3 and IMAP for incoming email?
    10·1 answer
  • Given an array a, write an expression that refers to the first element of the array .
    5·1 answer
  • You would like to narrow your search on this topic.
    15·2 answers
  • What is the code for this please?​
    13·1 answer
  • What word can you type using only the left home row keys and the right reach keys?
    6·2 answers
  • ASAP BRAINLIEST!!!
    6·1 answer
  • Which term best describes these lines?
    7·1 answer
  • When can designers use rapid application development?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!