Facebook Page Twitter Page LinkedIn Page
× Python Tutorial Python Advanced Python Resources Python Libraries


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 below example, 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))

The output of the above code will be:

8.0
27.98409999999999

❮ Python Math Module