diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2019-06-02 11:16:49 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-06-02 11:16:49 +0300 |
| commit | 5ae299ac78abb628803ab7dee0997364547f5cc8 (patch) | |
| tree | 243cb704ac7c8421e7406722912cc50e20b5ebad /Doc | |
| parent | d71f3170ac9c850f6d1f9bffaa628dc473df5e75 (diff) | |
| download | cpython-git-5ae299ac78abb628803ab7dee0997364547f5cc8.tar.gz | |
bpo-37128: Add math.perm(). (GH-13731)
Diffstat (limited to 'Doc')
| -rw-r--r-- | Doc/library/math.rst | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Doc/library/math.rst b/Doc/library/math.rst index 8c68370503..c5a77f1fab 100644 --- a/Doc/library/math.rst +++ b/Doc/library/math.rst @@ -207,6 +207,19 @@ Number-theoretic and representation functions of *x* and are floats. +.. function:: perm(n, k) + + Return the number of ways to choose *k* items from *n* items + without repetition and with order. + + It is mathematically equal to the expression ``n! / (n - k)!``. + + Raises :exc:`TypeError` if the arguments not integers. + Raises :exc:`ValueError` if the arguments are negative or if *k* > *n*. + + .. versionadded:: 3.8 + + .. function:: prod(iterable, *, start=1) Calculate the product of all the elements in the input *iterable*. |
