Question

Write a Python function evaluateFunction() that takes one floating point number x as its argument and...

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

Homework Answers

Answer #1

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

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
python pls Create function math_life() this function takes one or more argument. If this function called...
python pls Create function math_life() this function takes one or more argument. If this function called with no argument, raise typeError. The math_life() function returns to a function defined inside. this will take a one argument. For the second argument, it will calculate second function passed to math_life(). You should assume that the math_life() passed x functions, when it called the x times it will calculate the xth function passed to math_life() arguments when it called x+1 time it again...
Write a PYTHON program that takes the radius of a sphere (a floating-point number) as input...
Write a PYTHON program that takes the radius of a sphere (a floating-point number) as input and then outputs the sphere’s surface area. The Surface Area of a Sphere is Surface Area = 4πr² Surface Area = 4 * PI * radius * radius
Write a function find square root(x) that takes as input a number x and as output...
Write a function find square root(x) that takes as input a number x and as output returns the square root of x. Your results should converge to at least 6 decimal places. matlab question
Write a function named “highestScore” that takes an array of floating point scores and its size...
Write a function named “highestScore” that takes an array of floating point scores and its size as parameters and return the highest of these scores. The function prototype: float highestScore(float scores[], int size);
Write a Python program using that takes a number as input and then prints if the...
Write a Python program using that takes a number as input and then prints if the number is even or odd. The program should use a function isEven that takes a number as a parameter and returns a logical value true if the number is even, false otherwise.
5.34 Write a function statement() that takes as input a list of floating-point numbers, with positive...
5.34 Write a function statement() that takes as input a list of floating-point numbers, with positive numbers representing deposits to and negative numbers representing withdrawals from a bank account. Your function should return a list of two floating-point numbers; the first will be the sum of the deposits, and the second (a negative number) will be the sum of the withdrawals. >>> statement([30.95, -15.67, 45.56, -55.00, 43.78]) [120.29, -70.67]
Q1) Write a Python function partial_print, which takes one parameter, a string, and prints the first,...
Q1) Write a Python function partial_print, which takes one parameter, a string, and prints the first, third, fifth (and so on) characters of the strings, with each character both preceded and followed by the ^ symbol, and with a newline appearing after the last ^ symbol. The function returns no value; its goal is to print its output, but not to return it. Q2) Write a Python function called lines_of_code that takes a Path object as a parameter, which is...
TO BE DONE IN PYTHON: Write a function `lowest_integer()` which takes 2 input arguments: 1)a function...
TO BE DONE IN PYTHON: Write a function `lowest_integer()` which takes 2 input arguments: 1)a function `g` representing an increasing function g(x) 2) a number `gmin`, and returns an integer `nmin` such that nmin>0 is the smallest integer that satisfies g(nmin)>gmin. test: def g(n): return 2*n print(lowest_integer(g, 10)) Output: 6
In lambda calculus, a function denoted by λ takes exactly one argument and returns exactly one...
In lambda calculus, a function denoted by λ takes exactly one argument and returns exactly one output. With this in mind, write the λ-calculus expression of a function that takes two arguments and returns the second. Explain briefly (no more than 3-4 sentences) how your expression is doing what is being asked to do. [Hint: think about this function in terms of Currying.]
Python Jupyter Notebook Write a python function called profit that takes the number of meals (n)...
Python Jupyter Notebook Write a python function called profit that takes the number of meals (n) sold by a restaurant in a month and calculates the monthly profit given the following information: The selling price of each meal is 12 USD (same for all meals) There is a fixed cost of 2500 USD per month regardless of the number of meals sold. There is a variable cost of 6 USD per each meal sold profit= total revenue- total cost =...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT
Active Questions
  • Distinguish between the typical roles of geologist and engineers in dealing with groundwater problems. How do...
    asked 2 minutes ago
  • 5) A rock is thrown directly southeast (45 degrees to S and E), at an initial...
    asked 5 minutes ago
  • If 133.2 kJ of heat are added to 5.80 × 102 g of water at 22.0°C,...
    asked 6 minutes ago
  • true/false An unweighted path length measures the number of edges in a graph. Breadth first search...
    asked 14 minutes ago
  • Give an example of the effect of interest rate changes on a fixed coupon bond, what...
    asked 22 minutes ago
  • Thirty-two small communities in Connecticut (population near 10,000 each) gave an average of x = 138.5...
    asked 26 minutes ago
  • The value of the integral   ∫C(3x2+ycosx)dx+(sinx−4y3)dy∫C(3x2+ycos⁡x)dx+(sin⁡x−4y3)dy, where CC is an arbitrary path from A(−π,−1)A(−π,−1) to B(2π,1)B(2π,1),...
    asked 40 minutes ago
  • the ordinates of a 6-h unit hydrograph for a particular catchment are 0,10,30,50,40,30,20,10 and 0 m3/s...
    asked 41 minutes ago
  • Please solve this using R code Part 3: A particular item is handmade in two stages...
    asked 50 minutes ago
  • Compare the American Cousnelors Association (ACA) code of ethics regarding conflict of interest to the National...
    asked 50 minutes ago
  • A fisherman's scale stretches 3.2 cm when a 2.1 kg fish hangs from it. a) What...
    asked 1 hour ago
  • Compare the American Counselors Association (ACA) code of ethics regarding referral due to dual relationship possibility...
    asked 1 hour ago