diff options
Diffstat (limited to 'Doc/library/math.rst')
-rw-r--r-- | Doc/library/math.rst | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Doc/library/math.rst b/Doc/library/math.rst index 28ed5d21..ff937d2 100644 --- a/Doc/library/math.rst +++ b/Doc/library/math.rst @@ -210,7 +210,7 @@ Number-theoretic and representation functions of *x* and are floats. -.. function:: perm(n, k) +.. function:: perm(n, k=None) Return the number of ways to choose *k* items from *n* items without repetition and with order. @@ -218,6 +218,9 @@ Number-theoretic and representation functions Evaluates to ``n! / (n - k)!`` when ``k <= n`` and evaluates to zero when ``k > n``. + If *k* is not specified or is None, then *k* defaults to *n* + and the function returns ``n!``. + Raises :exc:`TypeError` if either of the arguments are not integers. Raises :exc:`ValueError` if either of the arguments are negative. |