Home >>Python math Module >Python math.pow() Method

Python math.pow() Method

Python math.pow() Method

Python math.pow() method in python is used to returns the first number to the power of the second number in the float to calculate the given power of a base. This method accepts only two number.

Syntax:
math.pow(x, y)

Parameter Values

Parameter Description
x It is required a number to represent the base
y It is required a number to represent the exponent
Here is an example of Python math.pow() Method:

import math
print(math.pow(5, 8))

Output:
390625.0
Example 2:

import math 
a = 4
b = 7
print(math.pow(a,b))
a = 4.3
b = 7.5
print(math.pow(a,b))
a = 2
b = 5
print(math.pow(a,b))
a = 7
b = 0
print(math.pow(a,b))

Output:
16384.0
56365.50687963299
32.0
1.0

No Sidebar ads