This repository has been archived by the owner on Apr 1, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 307
Create Python-Function-POW.md #989
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9d184f9
Create Python-Function-POW.md
nj4710 44d97b2
Update and rename Python-Function_POW.md to Python-Function-Pow.md
nj4710 c4cb617
Update Python-Function-Pow.md
nj4710 71c6ba2
Update Python-Function-Pow.md
nj4710 530b819
Update Python-Function-Pow.md
nj4710 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
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 | ||
``` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meaning add a new empty line after each heading and each code block.