Write a Python function evaluateFunction() that takes one floating point number x as its argument and returns 3√(log|x| )+3(x^3) The math module has a square root function and a logarithm function
The Python code is
def evaluateFunction(x): x=float(x) import math ans=3*math.sqrt(math.log(math.fabs(x)))+3*(x**3) print(ans) evaluateFunction(2.5)
The output is
49.746692286242975
The image of code is
Here we use Jupyter notebook for python
Get Answers For Free
Most questions answered within 1 hours.