Question: python , i will provide smart1 here please make sure that output shold be like in the picture above Write the function power(x, numbers)that returns

python , i will provide smart1 here
please make sure that output shold be like in the picture above

Write the function power(x, numbers)that returns a new list of numbers in x where the numbers are rounded to numbersdecimals. This is example: The code print ('smart1(z, 1) rounded:', power (smart1 (z, 1), 2)) And the output must be like that smart1 (z, 1) rounded: (1.33, 3.0, 4.0, 5.0, 3.0, 2.0, 1.0, 1.67] def sum(z, l, r): ans = 0 for i in range(l, r+1): ans += z[i] return ans Returns the y list (with repeating boundary values) def smart1(z, j): y = [] for i in range(0, len(z)): yi = 0 # ith element of # If lower boundary limit if i-j len(z)-1: len(z)-1 # then add the last yi += (i+j-len(z)+1): else: # else set upper bour i+j r = # Calculate remaining sur yi += sum(z, l, r) yi = yi/(2*j + 1) # Append the answer to th y.append(yi) return y
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
