Skip to content
This repository has been archived by the owner on Apr 1, 2021. It is now read-only.

Commit

Permalink
Create Python-Function-POW.md (#989)
Browse files Browse the repository at this point in the history
* Create Python-Function-POW.md

For issue #819

* Update and rename Python-Function_POW.md to Python-Function-Pow.md

* Update Python-Function-Pow.md

* Update Python-Function-Pow.md

* Update Python-Function-Pow.md
  • Loading branch information
nj4710 authored and Rafase282 committed May 20, 2016
1 parent 140efa9 commit a23b2e4
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Python-Function-Pow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Python pow(x,y)

`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](https://processing.org/reference/modulo.html) `z`

## Arguments

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.


## Return

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).



## Example

```python
print(pow(2,4)) # prints 16
print(pow(10,-2)) # prints 0.01
print(pow(4,3,5)) # prints 4
```
:rocket: [Run Code](https://repl.it/CTGi)

[Official Documentation](https://docs.python.org/3/library/functions.html#pow)

0 comments on commit a23b2e4

Please sign in to comment.