Python pow()

christian.dinh's avatar
Published May 10, 2021Updated Sep 3, 2021
Contribute to Docs

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

  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours
  • Machine Learning Data Scientists solve problems at scale, make predictions, find patterns, and more! They use Python, SQL, and algorithms.
    • Includes 27 Courses
    • With Professional Certification
    • Beginner Friendly.
      95 hours

Syntax

pow(x, y, z)

Example 1

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

Code
Output
Loading...

Example 2

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

Code
Output
Loading...

All contributors

Contribute to Docs

Learn Python on Codecademy

  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours
  • Machine Learning Data Scientists solve problems at scale, make predictions, find patterns, and more! They use Python, SQL, and algorithms.
    • Includes 27 Courses
    • With Professional Certification
    • Beginner Friendly.
      95 hours