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.