4.12 LAB: Using math methods Given three floating-point numbers x, y, and z, output x to the power of z, x to the power of (y to the power of z), the absolute value of y, and the square root of (xy to the power of z). Ex: If the input is:

Respuesta :

Answer:

The function is as follows:

import math

def func(x,y,z):

   print(math.pow(x, z))

   print(math.pow(x,math.pow(y, z)))

   print(math.fabs(y))

   print(math.sqrt(math.pow(x*y,z)))

Explanation:

This imports the math library

import math

This defines the function

def func(x,y,z):

Print the stated outputs as it is in the question

   print(math.pow(x, z)) ---> x to power x

   print(math.pow(x,math.pow(y, z))) ---- x to power of y of z

   print(math.fabs(y)) ---- absolute of y

   print(math.sqrt(math.pow(x*y,z))) --- square root of xy power x