Skip to content
Built-in Functions

pow()

Raise a number to a power.

pow(base, exp, mod=None)

pow(base, exp) gives the same result as using the ** operator.

A third argument can calculate the result modulo another number.

Parameters

NameDescription
baseThe number to raise.
expThe power to use.
modOptional modulus for a modular power calculation.

Returns

The calculated number.

Try it

Run it and change it
base = 2
print(pow(base, 3))

Related entries