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

Create Python-Function-POW.md #989

Merged
merged 5 commits into from
May 20, 2016
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions Python-Function-Pow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-## Arguments
+## Arguments
+

Meaning add a new empty line after each heading and each code block.

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
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a repl.it snippet with the working code

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