The math.pow() function is used to calculate the power of a number.
This function takes two arguments, a number (base) and a power to which the base is to be raised.
math.pow(x, y)
Where x
is the base and y
is the exponent.
The function returns the result of x
to the power of y
, as a floating value.
If x is negative and y is not an integer, a ValueError
is raised.