The pow() function - Python math module

The po() function in Python math module returns the value of a number raised to the specified power. In other words, it multiplies the number the power times.

Math Updated 25 Sep 2016 1 min read

Function signature

pow(aNumber_in, aPower_in)

Parameters

aNumber_in - The number which is to be raised to the specified power.
aPower_in - Specifies how many times aNumber_in has to be multiplied by itself.

Return value

The aNumber_in multiplied by aPower_in times by itself.

Function overview

The pow() method returns the number raised to the power specified.

Example

python
import math

#Find 2 raised to the power 5

TwoPowerFive = math.pow(2,5)

print("Value of 2 raised to the power 5 is: {}".format(TwoPowerFive))

#Find speed of the light - that is approximately 3*pow(10*8)

SpeedOfLight = 3*math.pow(10,8)

print("Speed of light is approximately:{}".format(SpeedOfLight))

Output

Output
Value of 2 raised to the power 5 is: 32.0

Speed of light is approximately:300000000.0 meters per second