Please help! cannot figure this out for the life of me
Given the function
f(x,n)= n**x(n-1)
5c. Using this function, calculate the rate of change of
(((2^3 + 3^2)^4 -2^4)^2 + (3^4 – (6^2 + 3)^4)^3)^3
This is what I came up with in IDLE:
def function(x, n):
return (n*(x**(n-1)))
assertEqual (
function ((((
function (2.0, 3.0))+(
function (3.0, 2.0)), 4.0)-(
function (2.0, 4.0)), 2.0)+((
function (3.0, 4.0))-((
function (6.0, 2.0))+(
function (3.0, 1.0)), 4.0), 3.0), 3.0), 35994405888.0)
and after I save and run it, I get this message:
Traceback (most recent call last):
File "C:\Users\Jonathan Cohen\Desktop\School\CISC 106\lab2.py", line 83, in <module>
assertEqual (function ((((function (2.0, 3.0))+(function (3.0, 2.0)), 4.0)-(function (2.0, 4.0)), 2.0)+((function (3.0, 4.0))-((function (6.0, 2.0))+(function (3.0, 1.0)), 4.0), 3.0), 3.0), 35994405888.0)
TypeError: unsupported operand type(s) for -: 'tuple' and 'float'