Python Tutorial Python Advanced Python References Python Libraries

Python math - pow() Function



The Python math.pow() function returns the base raise to the power of exponent.

Syntax

math.pow(base, exponent)

Parameters

base Required. Specify the base.
exponent Required. Specify the exponent.

Return Value

Returns the base raise to the power of exponent.

Example:

In the example below, pow() function is used to calculate the base raised to the power of exponent.

import math

print(math.pow(2, 3))
print(math.pow(2.3, 4))
print(math.pow(4.25, 6.25))

The output of the above code will be:

8.0
27.98409999999999
8461.177635716032

❮ Python Math Module

5