Python - Math pow() Function
The Python Math pow() function is used to return the base raise to the power of exponent.
Syntax
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