Question: I'm getting this error message found in the code. What am I doing wrong? How do I fix this? Here is the original question: Python

I'm getting this error message found in the code. What am I doing wrong? How do I fix this?

Here is the original question:

Python Question: For the following use a For loop. Write a function MakeSubintF (a, b, n) that returns a list of the endpoints of the subintervals, e.g. MakeSubint (7, 10, 3) should return the list [7, 8, 9, 10]. Verify that your function works with the intervals (a,b) = (7,10) (n=3); (12,19.5) (n=10); and (0,2pi) (n=8).

My code:

I'm getting this error message found in the code. What am I

def MakeSubintF(anD'n): # defines the function MakesubIntF(a,b,n) that returns a list of endpoints length = (b-a) # defines length of subintervals i- a # defines the starting point necessary for the following conditional statement results = [] # sets the list of results for i in range (a,b); results.append(i) # adds 1 to the end of results 1-1 + length # sets the start point for the loop return results # list of endpoints ranging from a to b import math # imports the math library used for pi rl -MakesubintF (7,10,3) # defines the list of endpoints for r1 r2 = MakeSub IntF( 12, 19.5, 10) # defines the list of endpoints for r2 r3 = MakeSubintF(0,2-math.pl, 8) # defines the list of endpoints for r3 print (r1) # prints r1 print (r2) # prints r2 print (r3 ) # prints r3 Traceback (most recent call last) TypeError Kipython-input-17-4a919bcc18f0> in 9 import math # imports the math library used for pi 10 r1 = MakeSubintF (7,10, 3) # defines the list of endpoints for r1 > 11 r2 = MakesubintF (12, 19.5, 10) # defines the list of endpoints for r2 12 r3 -MakeSubintF (0,2 *math. p1,8) # defines the list of endpoints for r3 13 print (r1) # prints r1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!