-
Notifications
You must be signed in to change notification settings - Fork 2
Python Function Pow
pow(x, y[, z])
is a built-in function in Python 3 to calculate x
to the power y
and if z
is present , returns x
to the power y
modulo z
The arguments must have numeric types.
This function takes two arguments, x
and y
, as well as three, x
,y
and z
.
If z
is present, x
and y
must be of integer types, and y must be non-negative.
If z
is present it returns x
to the power y
modulo z
.If only x
and y
are present it returns x
to the power y
(same as x**y).
print(pow(2,4)) # prints 16
print(pow(10,-2)) # prints 0.01
print(pow(4,3,5)) # prints 4
🚀 Run Code
Learn to code and help nonprofits. Join our open source community in 15 seconds at http://freecodecamp.com
Follow our Medium blog
Follow Quincy on Quora
Follow us on Twitter
Like us on Facebook
And be sure to click the "Star" button in the upper right of this page.
New to Free Code Camp?
JS Concepts
JS Language Reference
- arguments
- Array.prototype.filter
- Array.prototype.indexOf
- Array.prototype.map
- Array.prototype.pop
- Array.prototype.push
- Array.prototype.shift
- Array.prototype.slice
- Array.prototype.some
- Array.prototype.toString
- Boolean
- for loop
- for..in loop
- for..of loop
- String.prototype.split
- String.prototype.toLowerCase
- String.prototype.toUpperCase
- undefined
Other Links