
def isAscending(X):
for i in range(len(X)-1):#loop till n-1 where n is len(X)
if X[i]>X[i+1]:#if a pair found out of order, return false
return False
return True#if no pair found out of order, return true
def isInBounds(X,x):
return x>=X[0] and x<=X[-1]#return true if x>=first
element and x<= last element
def interpLin(x1,y1,x2,y2,x):
out = (float)(y2-y1)/(x2-x1)
out = out*(x-x1) + y1
return out#return value of out calculated using the formula
def interpQuad(x0,y0,x1,y1,x2,y2,x):
out = (float)(y2-y0)/(x2-x0)
out = out*(x-x1) + y1
out += (x-x1)*(x-x1)*(y2-2*y1+y0)/(2*(x2-x1)*(x2-x1))
return out#return value of out calculated using the formula
def index(X,x):
for i in range(len(X)-1):
if x >= X[i] and x<X[i+1]:#finds the i for which
X[i]<=x<X[i+1]
return i#return i
return len(X)-1#else return last index of X
Refer to image below for better understanding and proper indentation.

Sample output:

The comments in the code are only for you understanding. You can remove them if you want.
Please give this solution a thumbs up if you find it helpful. Kindly let me know in the comments if you have any doubts or issues in the solution. I would be happy to help you.
Thank you.
Write a library module that provides services for processing sequences. It should consist of a python...
Lab Exercise #15 Assignment Overview This lab exercise provides practice with Pandas data analysis library. Data Files We provide three comma-separated-value file, scores.csv , college_scorecard.csv, and mpg.csv. The first file is list of a few students and their exam grades. The second file includes data from 1996 through 2016 for all undergraduate degree-granting institutions of higher education. The data about the institution will help the students to make decision about the institution for their higher education such as student completion,...