pow()

Returns the value of a base number x to the power of an exponent y, with an optional modulus z.

Syntax

pow(x, y, z)

Example 1

Use pow() to return the result of 5 to the power of 3:

Example 2

Use pow() to return the result of 5 to the power of 3 with a modulus of 3:

Edit this page on GitHub

Contributors

Interested in helping build Docs? Read the Contribution Guide or share your feedback.

Learn Python on Codecademy

Edit this page on GitHub

Contributors